Hi All,
I have a table for logging phone calls that records the time of each record, looking something like this:
CallID--|-- Time--|-- Date --|--Call Reason
1 -----|--10:23--|-10/1/09--|- blah
2 -----|--11:45--|-10/1/09--|- blah
3 -----|--14:53--|-11/1/09--|- blah
I want to create a query that will count the number of calls per hour on each day. Something like:
Date----|-9-9.59-|-10-10.59-|-11-11.59---- etc.
10/1/09-|--- 2----|--- 3-----|--- 1------
11/1/09-|--- 1----|--- 4-----|--- 5------
Where the values 2, 3, etc. are a count of CallID for that date and time range.
Using the cross-tab query wizard, if you set 'Time' as the column headings, you can then group the columns, but only by things like month or quarter. That produces a query like the below:
TRANSFORM Count(Table2.id) AS CountOfid
SELECT Table2.Date, Count(Table2.id) AS [Total Of id]
FROM Table2
GROUP BY Table2.Date
PIVOT Format([Time],"mmm") In "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
I'm guessing it's the last line (PIVOT) that I need to worry about.
The red 'mmm' indicates the three digit month format, the blue indicates the column headings, but what to change them to?
I'm no Access/SQL expert - my sum knowledge comes from looking at the SQL and taking a guess at what it means, so any help would be great!
Thanks in advance, H.
I have a table for logging phone calls that records the time of each record, looking something like this:
CallID--|-- Time--|-- Date --|--Call Reason
1 -----|--10:23--|-10/1/09--|- blah
2 -----|--11:45--|-10/1/09--|- blah
3 -----|--14:53--|-11/1/09--|- blah
I want to create a query that will count the number of calls per hour on each day. Something like:
Date----|-9-9.59-|-10-10.59-|-11-11.59---- etc.
10/1/09-|--- 2----|--- 3-----|--- 1------
11/1/09-|--- 1----|--- 4-----|--- 5------
Where the values 2, 3, etc. are a count of CallID for that date and time range.
Using the cross-tab query wizard, if you set 'Time' as the column headings, you can then group the columns, but only by things like month or quarter. That produces a query like the below:
TRANSFORM Count(Table2.id) AS CountOfid
SELECT Table2.Date, Count(Table2.id) AS [Total Of id]
FROM Table2
GROUP BY Table2.Date
PIVOT Format([Time],"mmm") In "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
I'm guessing it's the last line (PIVOT) that I need to worry about.
The red 'mmm' indicates the three digit month format, the blue indicates the column headings, but what to change them to?
I'm no Access/SQL expert - my sum knowledge comes from looking at the SQL and taking a guess at what it means, so any help would be great!
Thanks in advance, H.