Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting by hours in a Date/Time field

Status
Not open for further replies.

jalge2

Technical User
Feb 5, 2003
105
0
0
US
I'm trying to figure out how many trucks we have had come into this facility in the last 24, 48, and 72 hours. I have a Date/Time Field with data showing

1/10/2005 6:00:00 AM

What do I put in the criteria to look back a certain amount of hours?

Thanks for the help.

Jason Alge
Jason.M.Alge@lowes.com

'There are three kinds of people: Those who can count and those who can't'
 
Code:
Where [DateField] >= DateAdd ("h", -72, Now() )
Should give you all records that are 72 hours before right now.
 
A starting point: DateAdd("h",-72,Now())

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top