I am trying to join two tables which have a common ID so that the count of matching records, including 0 is returned. It is that 0 count that I cannot achieve. The ID (EventType) is unique in one table, but not in the other, where it is called EVENT_TYPE in the SQL below. One of the other fields in the table with multiple entries must equal a supplied value - 316 in the SQL.
This is my SQL - straight out of the Access query designer.
SELECT EventNames.EventName, Count(EventNames.EventType
) AS CountOfEventType, [Individual Events].Date
FROM EventNames LEFT JOIN [Individual Events] ON EventNames.EventType = [Individual Events].EVENT_TYPE
GROUP BY EventNames.EventName, [Individual Events].MEMBER_ID, [Individual Events].Date
HAVING ((([Individual Events].MEMBER_ID)=316));
Start Free Trial