I am trying to write a query in MS Access 2013 and the left join is not working correctly. It is acting like a normal join.
Here is what I'm trying to do.
My first table [All Category Types]
has one column [Category Types]
. I am then trying to left join that to a query that has two aggregate fields in it. Virtual Table [Average by Category Type]
is first grouped by Owner, and then by [Category Type]
. Next is a sum field [CountOfIncident: Number]
.
What I want as a result is every item in table [All Category Types]
and then the correct [CountOfIncident: Number] where Owner == "France"
. This is not working as a left join. It is only showing me the values in [All Category Types]
that have a matching record in [Average by Category Type]
.
If I remove Owner from this table, and only group by [Category Type]
, it works just fine. Is there something about having more than one field in the group by clause that does not allow a left join on a query to work correctly?
SELECT [All Category Types].[Category Type],
[Average by Category Type].[CountOfIncident: Number]
FROM [All Category Types]
LEFT JOIN [Average by Category Type]
ON [All Category Types].[Category Type] = [Average by Category Type].[Category Type]
WHERE ((([Average by Category Type].Owner)="France"));
Thank you.