Display Data For A Specific Month.

eckert1961

Registered User.
Local time
Yesterday, 17:31
Joined
Oct 25, 2004
Messages
90
Hello,

I have an attendance report that displays student names, count of attendance for the month and the attendance percent. See the attached pdf.

Currently the report will display the data for every month but that will inevitably make for a very long report. What I would like to do is only display the data for a specific month. Here is the sql code for my current report query.

Code:
SELECT [LastName] & ", " & [FirstName] AS [Student Name], Format([AttendanceDate],"mmmm") AS AttMonth, Count(tblAttendance.AttendanceDate) AS Attendance, Format([AttendanceDate],"mm") AS SortMonth, GetWeekDays([Enter the Date],"46") AS [Total Classes]
FROM Members INNER JOIN tblAttendance ON Members.MemberID = tblAttendance.MemberID
GROUP BY [LastName] & ", " & [FirstName], Format([AttendanceDate],"mmmm"), Format([AttendanceDate],"mm"), GetWeekDays([Enter the Date],"46")
ORDER BY Format([AttendanceDate],"mm");

Any ideas on what I need to change? Thanks.

Chris
 

Attachments

After I posted this topic I changed my query to the following.

Code:
SELECT [LastName] & ", " & [FirstName] AS [Student Name], Format([AttendanceDate],"mmmm") AS AttMonth, Count(tblAttendance.AttendanceDate) AS Attendance, Format([AttendanceDate],"mm") AS SortMonth, GetWeekDays([Enter the Date],"46") AS [Total Classes], Month([AttendanceDate]) AS [Month]
FROM Members INNER JOIN tblAttendance ON Members.MemberID = tblAttendance.MemberID
GROUP BY [LastName] & ", " & [FirstName], Format([AttendanceDate],"mmmm"), Format([AttendanceDate],"mm"), GetWeekDays([Enter the Date],"46"), Month([AttendanceDate])
HAVING (((Month([AttendanceDate]))=[Enter the Month]))
ORDER BY Format([AttendanceDate],"mm");

This gives me the desired results but if anyone has any additional suggestions feel free to post them.

Thanks and regards,
Chris
 

Users who are viewing this thread

Back
Top Bottom