Displaying Records Entered in Prior 10 minutes

themurph2000

Fat, drunk, and stupid
Local time
Yesterday, 18:15
Joined
Sep 24, 2007
Messages
181
I apologize if this has been asked already, but I couldn't find the answer.

I have a field in a table that timestamps the date and time in which a record is entered. (using general date format: mm/dd/yyyy hh:mm AM/PM) I want to put a calculation in my query that will display all records that had been entered in the prior 10 minutes, so that a person wouldn't have to sort through all records entered for a particular day.

I know the Now() function could be of use here, but I wasn't sure how to set up the rest of the calculation so that 10 minutes (as opposed to days, months, etc) were subtracted as the criteria. Any suggestions?

Thanks
 
Check out the DateAdd function in help.
 
Check out the DateAdd function in help.


Perfecto. Took me a minute or two to mess with it, but it works. Thanks!

For those who wanted the answer, use the criteria >=DateAdd("n", -10, Now()) to grab all records created within the last 10 minutes, assuming you have a field that timestamps each new record in General Date format (mm/dd/yyyy, hh:mm AM/PM)
 
Last edited:
Just posting another solution that I've used in the past ...

Code:
DateDiff("n",[DateField],Now()) < 10

-dK
 

Users who are viewing this thread

Back
Top Bottom