Time() - 5 minutes

S

Scott

I have an update query that adds the time to a field as well as various other
updates. I am trying to run a subsequent query that I am trying to get it to
pull all records with the current date from the date field (no problem with
portion), and with all records where the time field is within the last 5
minutes of the current time (This is the part I'm having problems).

The reason for this is, it is a multi-user database, and this query will be
sending e-mail messages out to individuals with an expiration date soon to
expire, and I'm trying to put a limit on it, so they don't receive the same
e-mail several times in one day.

Any help would be greatly appreciated.
 
J

John W. Vinson

I have an update query that adds the time to a field as well as various other
updates. I am trying to run a subsequent query that I am trying to get it to
pull all records with the current date from the date field (no problem with
portion), and with all records where the time field is within the last 5
minutes of the current time (This is the part I'm having problems).

The reason for this is, it is a multi-user database, and this query will be
sending e-mail messages out to individuals with an expiration date soon to
expire, and I'm trying to put a limit on it, so they don't receive the same
e-mail several times in one day.

Any help would be greatly appreciated.

Take a look at the DateAdd() function. If the date field contains both the
date and time, use Now() to get the current clock time, and

DateAdd("n", -5, Now())

to get the time five minutes ago.

The Time() function returns a pure time - in fact, a date/time value sometime
on December 30, 1899, which is the zero point of the date/time system. A
Date/Time value is a double float count of days and fractions of a day since
midnight on that date; so 0.75 would be #12/30/1899 18:00:00#.
 
S

Scott

I believe we are almost there, if i need all between now() and the last 5
minutes would the formula be as follows:


between DateAdd("n", -5, Now()) and Now()

I appreciate your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top