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

formula for subtracting time in next row 2

Status
Not open for further replies.

ziggs

Technical User
Sep 21, 2000
195
US
I'm looking for a formula for a query that will subtract the time in seconds when comparing one row to the next row. For example, here's the time

1 08/10/08 09:08:07
2 08/10/08 09:09:00
3 08/10/08 09:09:37
4 08/10/08 09:10:45

and I would like to see the amount of seconds like this:

1 08/10/08 09:08:07 null
2 08/10/08 09:09:00 53 seconds
3 08/10/08 09:09:37 37 seconds
4 08/10/08 09:10:45 68 seconds

I tried something like
diff: (DateDiff("s",[DateTime1],[DateTime1])) but that didn't work. DateTime1 is the name of the DateTime column.
 
If you wanted to you can fix the VBA one too with the same fix - the '5','19' in the mid function!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top