Question Locked

Access 2003 Query for Between Date and Times

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to create a query that will sum up production numbers based on a Date criteria. Normally not a problem but, this needs to run daily so it needs to be somewhat dynamic. Basically, I need to know how many pieces were produced between yesterday at 3AM and today at 3AM each day. When user enters their data, the record is stamped with the date and time they entered the data. Normally, I would use Between Date()-1 and Date() or >=Date()-1 but, because records are entered after midnight, this does not work as needed.

Thanks in advance for your help.

3 replies

by john.a.wills

There is an add function available for date and time; one can specify (in this case) -1 to be added to the current time's day part. I am afraid I am a bit hazy on the details, as I do not currently work in Access, but there is pretty good built-in help.

by maevinn

Between: Today-1 where time>0300 and Today where time<0300.

You can extract just the time value from the date field and process them seperately.

This discussion is closed to new replies.