Thread: querying time
View Single Post
  #3  
Old April 23rd, 2008, 11:36 PM
shirl shirl is offline
Experienced Member
 
First recorded activity by OfficeFrustration: Mar 2005
Posts: 39
Default

John

Thanks for the reply, I have done what you said and it worked, the only problem I now have is that I want to show the hour in the 24 hour clock, ie 1pm in the afternoon should display as 13.00 currently it is showing as 13

I have looked at the properties in the query and report and there is no option for date/time only numeric, any suggestions?

Shirley

Quote:
Originally Posted by John Spencer View Post
SELECT Department
, [Date called]
, Hour([Time Called]) as TheHour
, Count([Time Called]) as CallCount
FROM [Your Table]
GROUP BY Department
, [Date called]
, Hour([Time Called])

In the query design grid,
-- Add your table
-- add Department, Date Called, and Time Called (twice)
-- Change the first time called to
Field: TheHour: Hour([Time Called])
-- Select View: Totals from the menu
-- Change GROUP BY to COUNT under the second instance of [Time Called]
Save the query

If you want you can use this query to build a cross tab query to show
the data.

'================================================= ===
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'================================================= ===


shirl wrote:
I have been given a database, which has been used to record incoming
calls, the user enters the time someone phones in, the department name
and person they were put through to.

They now want to be able to record the number of calls to departments
on an hourly basis and display this in a report, so that they can see
which departments get the most calls.

The report is to display the list of calls by date, department and a
total number of calls to a department between say 09.00 and 10.00,
10.00 and 11.00 and so on.

Fields in the database are, Caller, date called, time called, contact,
department. Time called is short time format.

I'm not sure of the best way to do this, so would welcome suggestions.

Shirl