-
Help with Time Intervals
Hello --
I am trying to write a query where it lists the total for all the events that take place during each hour of the day (00:00 - 23:00). I have a time field that lists what time the event took place.
Example if I had events taking place at 1:15, 23:30, 14:43, and 1:30 the query would list
Time/No. of Events
00:00/0
01:00/2
02:00/0
03:00/0
.....
13:00/0
14:00/1
15:00/0
.....
22:00/0
23:00/1
Any help you could provide would be greatly appreciated.
-
Try:
SELECT Hour([TimeField]) AS TheHour, Count([TimeField]) AS NumEvents
FROM YourTable
GROUP BY Hour([TimeField])
ORDER BY Hour([TimeField])
-
-
You're welcome
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules