Hello, am trying a report that counts the number of Students who completed a specific lesson, grouped by month. The problem occurs when no students are counted for a month, instead of 0 it skips the month entirely. So the query:
SELECT Month([DateReceived]) AS Mnth, Count(tblStudent.StudID) AS CountOfStudID
FROM tblStudent INNER JOIN tblStudentLessons ON tblStudent.StudID = tblStudentLessons.StudID
WHERE (((tblStudentLessons.LessonID)=283) AND ((tblStudentLessons.DateReceived) Between #1/1/2010# And #12/31/2010#))
GROUP BY Month([DateReceived]);
returns:
Mnth CountOfStudID
January 1
March 1
when what I want it to return is:
Mnth CountOfStudID
January 1
February 0
March 1
April 0
May 0
etc.
I've tried various incarnations of Nz, using IIF conditions, nothing seems to quite get what I need.
Any help would be much appreciated. Thanks!
SELECT Month([DateReceived]) AS Mnth, Count(tblStudent.StudID) AS CountOfStudID
FROM tblStudent INNER JOIN tblStudentLessons ON tblStudent.StudID = tblStudentLessons.StudID
WHERE (((tblStudentLessons.LessonID)=283) AND ((tblStudentLessons.DateReceived) Between #1/1/2010# And #12/31/2010#))
GROUP BY Month([DateReceived]);
returns:
Mnth CountOfStudID
January 1
March 1
when what I want it to return is:
Mnth CountOfStudID
January 1
February 0
March 1
April 0
May 0
etc.
I've tried various incarnations of Nz, using IIF conditions, nothing seems to quite get what I need.
Any help would be much appreciated. Thanks!