If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Query Time/Date Problem
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 |
#2
|
|||
|
|||
Query Time/Date Problem
Try this --
WHERE DateValue(DateAdd("n", -930,qrymain.adate)) = [Enter date - 3/22/2008] -- KARL DEWEY Build a little - Test a little "Georgie" wrote: 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 |
Thread Tools | |
Display Modes | |
|
|