Jim Dudley
Registered User.
- Local time
- Today, 00:49
- Joined
- Feb 16, 2012
- Messages
- 81
In a cross tab query is it possible to put a qualifier in the Pivot statement to group all values over a certain amount?
SQL:
TRANSFORM Count(tbl_Attendance.Type) AS CountOfType
SELECT tbl_Attendance.WCode, tbl_Attendance.SNUM, Count(tbl_Attendance.Type) AS [Total Of Type]
FROM tbl_Attendance
WHERE (((tbl_Attendance.Credits)<=4))
GROUP BY tbl_Attendance.WCode, tbl_Attendance.SNUM
PIVOT tbl_Attendance.Credits;
e.g. The Pivot is on [Credits].
What I want is a count of students with 1 credit, 2 credits, 3 credits and 4 or more( >=4). in the 4th column. How would you write this instruction, if it is possible.
Thank you.
Jim
SQL:
TRANSFORM Count(tbl_Attendance.Type) AS CountOfType
SELECT tbl_Attendance.WCode, tbl_Attendance.SNUM, Count(tbl_Attendance.Type) AS [Total Of Type]
FROM tbl_Attendance
WHERE (((tbl_Attendance.Credits)<=4))
GROUP BY tbl_Attendance.WCode, tbl_Attendance.SNUM
PIVOT tbl_Attendance.Credits;
e.g. The Pivot is on [Credits].
What I want is a count of students with 1 credit, 2 credits, 3 credits and 4 or more( >=4). in the 4th column. How would you write this instruction, if it is possible.
Thank you.
Jim