Hi all.I have the following SQL statementSELECT DISTINCT CONVERT(VARCHAR,start_time,108) + ' - ' + CONVERT(VARCHAR,end_time,108), SUM((CASE day_of_week when 0 then 1 ELSE 0 END)) AS Monday, SUM((CASE day_of_week when 1 then 1 ELSE 0 END)) AS Tuesday, SUM((CASE day_of_week when 2 then 1 ELSE 0 END)) AS Wednesday, SUM((CASE day_of_week when 3 then 1 ELSE 0 END)) AS Thursday, SUM((CASE day_of_week when 4 then 1 ELSE 0 END)) AS Friday FROM ct_module, ct_event, ct_event_module, ct_event_room, ct_room, ct_siteWHERE ct_event.event_id = ct_event_module.event_idAND ct_event_module.module_id = ct_module.module_idAND ct_event.event_id = ct_event_room.event_idAND ct_event_room.room_id = ct_room.room_idAND ct_room.site_id = ct_site.site_idAND SUBSTRING(ct_site.name,1,3) = 'KWA'GROUP BY start_time, end_time, day_of_week
which produces the following results.Column1 Monday Tuesday Wednesday Thursday Friday08:30:00 - 09:30:00 0 0 0 0 2808:30:00 - 09:30:00 0 0 0 17 008:30:00 - 09:30:00 0 0 23 0 008:30:00 - 09:30:00 0 21 0 0 008:30:00 - 09:30:00 19 0 0 0 008:30:00 - 10:00:00 0 0 2 0 008:30:00 - 10:00:00 0 1 0 0 008:30:00 - 10:20:00 1 0 0 0 008:30:00 - 10:30:00 0 0 0 0 108:30:00 - 10:30:00 0 0 0 3 008:30:00 - 10:30:00 0 0 1 0 008:30:00 - 10:30:00 0 3 0 0 008:30:00 - 10:30:00 1 0 0 0 0what I want is to have one row per time period and have the counts for all the days on the same lines. eg.08:30:00 - 09:30:00 19 21 23 17 28I tried using WITH ROLLUP but was a bit confused that it produced about 20 rows where the time column was null despite the fact that there are no null values for either start_time or end_time! That got me the single line on some time periods but there are still all the other individual lines included too.any ideas?