Does any one know what is incorrect in the query below?
SELECT S1.[Company], COUNT(S1.[Milestone]) AS ShouldBeMilestones
FROM Sheet1 AS S1
INNER JOIN Sheet1 S2
ON S2.[Company] = S1.[Company]
AND S2.[Project] = S1.[Project]
AND S2.[Milestone] = 'Milestone 1'
AND S2.[%compl#] = 100
INNER JOIN Sheet1 S3
ON S3.[Company] = S1.[Company]
AND S3.[Project] = S1.[Project]
AND S3.[Milestone] = 'Milestone 2'
AND S3.[%compl#] = 100
WHERE ((S1.[Task class] <> 'A') AND (S1.[Task class] <> 'B') AND (S1.[Task class] <> ''))
AND S1.[Milestone] NOT LIKE '0.*' AND S1.[Milestone] NOT LIKE '1.*'
AND S1.[Start] <= Now()
GROUP BY S1.[Company];
I am getting a “Syntax Error in FROM clause” message when running it in a MS Access 2010…
Any idea would be appreciated!
Thanks,
MS Access SQL is strange in that you have to put parentheses around the
JOINs in multi-JOIN queries. I hate this feature and have yet to solve the “logic” behind it myself. You might have luck re-building a simple version of this in Access query-builder, and then editing it without messing with the parentheses.