Query showing Date between record and previous record

emorris1000

Registered User.
Local time
Yesterday, 16:48
Joined
Feb 22, 2011
Messages
125
I have a table of records that shows a series of events. Each record represents 1 event with 1 date given to it. I need to know the time between that event and the event that occured directly before it.

So like record 1 would be 1/1/2001. Record 2 would be 1/5/2001. Record 3 would be 1/25/2001. The query would return "4 days" (or whatever format) for record 2 and "20 days" for record 3.

I've done something similar to this before with an SQL query that did a numerical integration, but I can't believe that is necessary here.
 
Ah ok, yeah that's along the lines of what I did for the integration query. Its an ugly little piece of sql.
 
Happy to help. I don't know of a cleaner way to get data from a different record in a query.
 

Users who are viewing this thread

Back
Top Bottom