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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing time in seconds 1

Status
Not open for further replies.

WynneSMI

Programmer
Dec 16, 2002
76
US
I have a field in a table that has a Date/Time format (General Date, 1/1/2003 12:00:00 AM). I'm calling a function that checks to see if the date/time in the table is less than 10 seconds versus the current date/time. In other words, has 10 seconds elapsed between Now() and the time in the table. How can I compare two date/times with seconds?!? Thanks for any help.
 
Look at the DateDiff function. That should do it.
If DateDiff("s",[datefield],Now()) >10 Then

double check the argument for seconds. I put "s" but it may be some other value.

Paul
 
Thanks! "s" works! The DateDiff gives me what I want!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top