G'day
I have Follow SQL statment
SELECT convert(char(08),[call start],3) as Day,
SUM(CASE WHEN DATEPART(hour,[call start]) = 0 THEN 1 ELSE 0 END) AS '00',
SUM(CASE WHEN DATEPART(hour,[call start]) = 1 THEN 1 ELSE 0 END) AS '01',
SUM(CASE WHEN DATEPART(hour,[call start]) = 2 THEN 1 ELSE 0 END) AS '03',
SUM(CASE WHEN DATEPART(hour,[call start]) = 3 THEN 1 ELSE 0 END) AS '04',
.
.
.
SUM(CASE WHEN DATEPART(hour,[call start]) = 23 THEN 1 ELSE 0 END) AS '23'
What this does is counts the number of calls in the hour
What I need to do is get in a nice table or tables the has
the following inforamtion
Avg # of by hour for each day for the past 5 weeks and past week..
The Table could like some thing like
Sun Mon Thu . . . Sat
00 5 7 8 2
01 12 52 43 34
.
. (YOU GET THE IDEA)
.
22 12 54 21 12
23 4 5 78 134
Any Idea??
Cheers
Rich
I have Follow SQL statment
SELECT convert(char(08),[call start],3) as Day,
SUM(CASE WHEN DATEPART(hour,[call start]) = 0 THEN 1 ELSE 0 END) AS '00',
SUM(CASE WHEN DATEPART(hour,[call start]) = 1 THEN 1 ELSE 0 END) AS '01',
SUM(CASE WHEN DATEPART(hour,[call start]) = 2 THEN 1 ELSE 0 END) AS '03',
SUM(CASE WHEN DATEPART(hour,[call start]) = 3 THEN 1 ELSE 0 END) AS '04',
.
.
.
SUM(CASE WHEN DATEPART(hour,[call start]) = 23 THEN 1 ELSE 0 END) AS '23'
What this does is counts the number of calls in the hour
What I need to do is get in a nice table or tables the has
the following inforamtion
Avg # of by hour for each day for the past 5 weeks and past week..
The Table could like some thing like
Sun Mon Thu . . . Sat
00 5 7 8 2
01 12 52 43 34
.
. (YOU GET THE IDEA)
.
22 12 54 21 12
23 4 5 78 134
Any Idea??
Cheers
Rich