Query Time/Date Problem

G

Georgie

Good Morning, I searched around and couldn't find another thread with this
particular issue so here goes...
I have a database where customers get logged in when they come into reception.
I have name, phone#, visit#, what they came in for, and an ADATE to log the
exact date and time they came in. I have a query that counts the number of
customers from 3:30pm one day to 3:30pm the next (or whatever day I choose).
I tested this extensively while I was building it and all worked perfectly
but now that I actually have it in use I found a problem. Yesterday it
worked fine but I ran it last night to view customers that came in after 3:
30pm and it included one customer from 9:42:03am. No one else from the the
rest of the day, just that one.

Qry statement:
SELECT qryMain.[phone#], qryMain.name, qryMain.notes, qryMain.[visit#],
qryMain.adate, qryMain.reception
FROM qryMain
WHERE (((qrymain.adate)>DateValue([StartDate])+TimeSerial(15,30,0) And
(qrymain.adate)<DateValue([EndDate])+TimeSerial(15,30,0)));

Anyone have any idea what could cause that or how to fix? I don't want it to
keep happening and continually skew my numbers. Greatly appreciate any
help/ideas.
Thank You
 
K

KARL DEWEY

Try this --
WHERE DateValue(DateAdd("n", -930,qrymain.adate)) = [Enter date - 3/22/2008]
 

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