A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query Time/Date Problem



 
 
Thread Tools Display Modes
  #1  
Old June 27th, 2008, 03:29 PM posted to microsoft.public.access.reports
Georgie[_3_]
external usenet poster
 
Posts: 5
Default 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  
Old June 27th, 2008, 03:50 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.