This is what I used:
Code:
tblJustificationCategories (Just_ID autonumber primary key)
Just_ID JustDesc
1 Just - 1
2 Just - 2
3 Just - 3
4 Just - 4
tblRestDaysWorked (RDW_ID autonumber primary key, Rest_Day date)
RDW_ID Rest_Day Just_ID
1 1/1/2012 1
2 1/2/2012 2
3 1/3/2012 2
4 2/1/2012 1
5 2/2/2012 3
etc.
This is the query I used:
Code:
SELECT Right(DatePart("yyyy",[rest_day]),2) & "-" & DatePart("m",[rest_day]) AS Period_Text_Conv, tblJustificationCategories.JustDesc, Count(tblJustificationCategories.JustDesc) AS CountOfJustDesc
FROM tblRestDaysWorked LEFT JOIN tblJustificationCategories ON tblRestDaysWorked.Just_ID = tblJustificationCategories.Just_ID
GROUP BY Right(DatePart("yyyy",[rest_day]),2) & "-" & DatePart("m",[rest_day]), tblJustificationCategories.JustDesc;