Query using time

S

Sue

I have a data table imported from Excel that shows healthcare patients who
were seen in each Convenient Care facility by date and time and PCP. I need
to create a report or criteria that shows everyone seen from 8am to 12pm,
12-4 and 4-8 on each date. The times in the Excel spreadsheet are for
instance 8:15 AM or 4:50 PM. How would I set this up? Thanks!
 
D

Dorian

You need to get the data imported into a table column set up as 'date/time'
in Access. Then you can use a query with a WHERE clause something like:
WHERE TimeValue(ColumnName) BETWEEN #08:15:00# AND #16:50:00#
Look up Time Value function in Access Help for more details.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
J

Jeff Boyce

Sue

Is the raw data from Excel a text value or an actual date/time value? Check
the table definition. "How" depends on "what"...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KARL DEWEY

Try this --
SELECT Format([Date Visit],"m/d/yyyy") AS Date_Seen, Partition(Format([Date
Visit],"h"),8,16,4) AS [Interval], Count([Change Requests].[Date Visit]) AS
Patients_Seen
FROM [Change Requests]
WHERE ((([Change Requests].[Date Visit]) Between #8/25/2008# And #8/26/2008#))
GROUP BY Format([Date Visit],"m/d/yyyy"), Partition(Format([Date
Visit],"h"),8,20,4);

Partition(number, start, stop, interval)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top