Web Development



count records between a specific time range

By Acqanal ·
I have a table with an "Admit_Time" column. I need to count the records for 3 specific time ranges a) >= 00h and <= 0700h, b) > 0700h and <= 1700h, c) >1700h and <= 2400h.

I tried to created a query with using the criteria >#00:00:00 AM# And <=#07:00:00 AM# in the 'Admit_Time' field but Access won't accept the 00:00:00 AM. It kept replacing it with 12:00:00 AM.

If there is a better way to accomplish what I am trying to do, I would appreciate your help.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

DatePart function

by Tony Hopkinson In reply to count records between a s ...

Datepart("h",Admit_Time) will return 0 to 23

Daresay it's a locale problem in terms of the time format, always iffy those.

Your ranges are a minute out as well

< 7
>= 7 and < 17
> 17

2400 doesn't exist, that's tomorrow

Related Discussions

Related Forums