Would someone please help me understand why my query is not being accepted by Access? I’m at my wit’s end.
SELECT
NCR.Stage
, AG.ID AS AgeGroup
, Count(*) AS AgeGroupCount
FROM (
qry1 AG
LEFT JOIN qry1 AGi ON (
AG.ID = AGi.ID + 1
)
)
LEFT JOIN qry2 AS NCR ON (
AG.AgeGroupLowerLimit <= NCR.Age
AND (
AGi.ID IS NULL
OR AGi.AgeGroupLowerLimit > NCR.Age
)
)
GROUP BY
NCR.Stage
, NCR.AgeGroup
;
The problem is related to the second left join, with qry2.
I’m posting here because I expect it’s going to be something extremely simple I just don’t know to look for, and of course Access itself is extremely unhelpful.
Thank you!