[WD22] Warning in query

Startbeitrag von Stefan Bentvelsen am 22.05.2017 08:54

Hi,

for test I have converted a WD19-project to WD22 and now there's a funny warning in a query that I do not understand ( Warning : The item of the join condition does not affect the joined tables. QRY_Select_EdkKoppels_voorPlanningVB, SQL Code, line 29, column 96)
but inWD19 this query has no warning and runs fine:

SELECT
TblEdkKoppel.TblEdkKoppelID AS TblEdkKoppelID,
TblEdkKoppel.Aantaldieren AS Aantaldieren,
TblEdkKoppel.aantalGeleverd AS aantalGeleverd,
TblEdkKoppel.Opzetdatum AS Opzetdatum,
TblEdkKoppel.tblHokID AS tblHokID,
TblEdkKoppel.tblRasID AS tblRasID,
TblEdkKoppel.tblRelatieID_Voerleverancier AS tblRelatieID_Voerleverancier,
TblEdkKoppel.TblrelatieID_vleeskuikenhouder AS TblrelatieID_vleeskuikenhouder,
TblEdkKoppel.TblRelatieID_afnemer AS TblRelatieID_afnemer,
TblHok.tblHokCode AS tblHokCode,
TblRas.Rascode AS Rascode,
TblRelatie.Bedrijfsnaam AS Vleeskuikenhouder,
TblRelatieIntegratie.Bedrijfsnaam AS Integratie,
TblRelatieVoerlev.Bedrijfsnaam AS Voerleverancier,
TblEdkKoppel.voorbroed AS voorbroed,
TblEdkKoppel.Hatchcare AS Hatchcare,
TblEdkKoppel.plus4 AS plus4,
TblEdkKoppel.TblArtikelID_enting AS TblArtikelID_enting,
TblEdkKoppel.leverdatum AS leverdatum,
TblEdkInleg.CodeFlockCD AS CodeFlockCD,
CASE WHEN TblEdkInleg.CodeFlockCD IS NULL THEN 1 ELSE 0 END AS NietGepland,
FileFlock.dateFlockStartDateBirth AS dateFlockStartDateBirth
FROM
TblEdkKoppel LEFT OUTER JOIN TblHok ON TblHok.tblHokID = TblEdkKoppel.tblHokID
LEFT OUTER JOIN TblRas ON TblRas.tblRasID = TblEdkKoppel.tblRasID
LEFT OUTER JOIN TblRelatie ON TblRelatie.TblRelatieID = TblEdkKoppel.TblrelatieID_vleeskuikenhouder
LEFT OUTER JOIN TblRelatie AS TblRelatieIntegratie ON TblRelatieIntegratie.TblRelatieID = TblEdkKoppel.TblRelatieID_afnemer
LEFT OUTER JOIN TblRelatie AS TblRelatieVoerlev ON TblRelatieVoerlev.TblRelatieID = FileFlock.KeyRelationID_Voerleverancier //

I've tried that, but than I get the same error on "CodeFlockCD" of TblEdkInleg.CodeFlockCD in the join with FileFlock?!?
Do have another suggestion, may be?

Thanks for your effort.von Stefan Bentvelsen - am 30.05.2017 10:46

Re: [WD22] Warning in query (SOLVED)

Hi Jonathan,

I've found what the problem was. All joins where without commas which means that they where seemingly joined with TblEdkKoppel, but FileFlock is joined with TblEdkInleg, so I have added the table TblEdkInleg before the LEFT OUTER JOIN (with a comma after the previous join) and the same kind of problem was in the join between FileFlock and TblRelatieVoerlev. WD19 never had a problem with that, WD22 does.
Thanks again for your help.