G
Guest
Hello,
I've built my query, and it works, but if I go into the SQL view it
generically informs me I have a "Syntax error in FROM clause" and sets the
cursor to the comma before "Max(Year)" in line 3. Any ideas what Access
doesn't like?
SELECT Q.[CountryID], Q.[Output], Q.Year
FROM [TableName] AS Q INNER JOIN
[SELECT [CountryID], Max(Year) As S
FROM (SELECT R.[CountryID], R.[Year], R.[Output]
FROM [TableName] as X INNER JOIN
[TableName] as R ON X.ID=R.ID WHERE R.[Output] Is Not Null)
GROUP BY [CountryID]]. AS T ON (Q.Year = T.S) AND
(Q.[CountryID]=T.[CountryID]);
Basically my goal is to return the most recent non-null entry in the output
column.
I've built my query, and it works, but if I go into the SQL view it
generically informs me I have a "Syntax error in FROM clause" and sets the
cursor to the comma before "Max(Year)" in line 3. Any ideas what Access
doesn't like?
SELECT Q.[CountryID], Q.[Output], Q.Year
FROM [TableName] AS Q INNER JOIN
[SELECT [CountryID], Max(Year) As S
FROM (SELECT R.[CountryID], R.[Year], R.[Output]
FROM [TableName] as X INNER JOIN
[TableName] as R ON X.ID=R.ID WHERE R.[Output] Is Not Null)
GROUP BY [CountryID]]. AS T ON (Q.Year = T.S) AND
(Q.[CountryID]=T.[CountryID]);
Basically my goal is to return the most recent non-null entry in the output
column.