Question

I'm using Access 2010 and I'm getting a "JOIN expression not supported" error when I try to save my query. Here's a simplified version of the query:

SELECT Sum(1) AS [Total People], Place.Name
FROM (([Person]
LEFT JOIN [Place] ON [Place].[Name] = [Person].[Place])
LEFT JOIN [Thing] ON [Thing].[Place] = [Place].[Name] 
  AND [Thing].[Owner] = [Person].[Name])
GROUP BY [Place].[Name]
HAVING [Thing].[Type] = "Food"

If I remove this from the Join statement the query can be saved.

AND [Thing].[Owner] = [Person].[Name]

Of course I would need to add the following HAVING statements in order for the query to return something that's functionally equivalent.

AND [Thing].[Owner] = [Person].[Name]
AND [Place].[Name] IS NOT NULL
AND [Thing].[Place] IS NOT NULL

The problem is that once I add these statements to my HAVING clause, I have to change my GROUP BY clause to also include these fields, and that changes the output from the desired result.

Am I trying to do the impossible, or am I wrong about something?

No correct solution

OTHER TIPS

Take out the brackets around your joins, add brackets around the join predicates.

http://social.msdn.microsoft.com/Forums/office/en-US/15c36745-f7a4-4926-9687-7161e5894468/join-expression-not-supported-error-caused-by-unbracketed-join-expression-comprising-string?forum=accessdev

SELECT Sum(1) AS [Total People], Place.Name
FROM [Person]
LEFT JOIN [Place] ON [Place].[Name] = [Person].[Place]
LEFT JOIN [Thing] ON ( [Thing].[Place] = [Place].[Name] 
                 AND [Thing].[Owner] = [Person].[Name])
GROUP BY [Place].[Name]
HAVING [Thing].[Type] = "Food"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top