Using Access 2003 with 2000 format
Here's my crosstab query
I want to do 2 things...
1. Sort in the order by the Sort column which is based on a Switch function, i.e. October, November, December, January, February...through to September. And I do not want to use Fixed Column Headings, because that won't work in this instance.
2. Show each member across on one line - e.g. Anderson, Oct 08, Nov 08, Dec 08, Jan 09...on through to Sep 09.
Can anyone suggest how to fix this so that happens?
Thanks.
Tom
Here's my crosstab query
Code:
PARAMETERS [Forms]![frmDateSelector]![txtStartDate] DateTime, [Forms]![frmDateSelector]![txtEndDate] DateTime;
TRANSFORM Count(tblAttendance.Present) AS CountOfPresent
SELECT tblMembers.MemberID, [LastName] & ", " & [PreferredName] AS FullName, tblAttendance.TypeOfMeeting, Count(tblAttendance.MeetingDate) AS [Meetings Attended]
FROM tblMembers LEFT JOIN tblAttendance ON tblMembers.MemberID = tblAttendance.MemberID
WHERE (((tblAttendance.TypeOfMeeting)="Regular Meeting") AND ((tblMembers.Status)<>"Deceased" And (tblMembers.Status)<>"Transferred Out") AND ((tblAttendance.Present)=Yes))
GROUP BY tblMembers.MemberID, [LastName] & ", " & [PreferredName], Switch(Month([MeetingDate])=10,1,Month([MeetingDate])=11,2,Month([MeetingDate])=12,3,Month([MeetingDate])=1,4,Month([MeetingDate])=2,5,Month([MeetingDate])=3,6,Month([MeetingDate])=4,7,Month([MeetingDate])=5,8,Month([MeetingDate])=6,9,Month([MeetingDate])=7,10,Month([MeetingDate])=8,11,Month([MeetingDate])=9,12), tblMembers.Status, tblAttendance.TypeOfMeeting
ORDER BY [LastName] & ", " & [PreferredName], Sort: Switch(Month([MeetingDate])=10,1,Month([MeetingDate])=11,2,Month([MeetingDate])=12,3,Month([MeetingDate])=1,4,Month([MeetingDate])=2,5,Month([MeetingDate])=3,6,Month([MeetingDate])=4,7,Month([MeetingDate])=5,8,Month([MeetingDate])=6,9,Month([MeetingDate])=7,10,Month([MeetingDate])=8,11,Month([MeetingDate])=9,12), Format([MeetingDate],"mmm yyyy") DESC
PIVOT Format([MeetingDate],"mmm yyyy");
I want to do 2 things...
1. Sort in the order by the Sort column which is based on a Switch function, i.e. October, November, December, January, February...through to September. And I do not want to use Fixed Column Headings, because that won't work in this instance.
2. Show each member across on one line - e.g. Anderson, Oct 08, Nov 08, Dec 08, Jan 09...on through to Sep 09.
Can anyone suggest how to fix this so that happens?
Thanks.
Tom