View Full Version : Accessing previous row


ya5irha55an
07-04-2008, 03:03 AM
Hi all, i hope someone can hlep with the following:

I have a table like:

Date
01/01/2005
10/06/2007
12/12/2004
01/03/2006
02/03/3006

I would like to create a query which calculates the difference between the date in each row and the date in the previous row. So the difference between date in row 1 and row 2, then row 2 and row 3. So it would look like:

Date Difference
01/01/2005
10/06/2007 340
12/12/2004 -200
01/03/2006 400
02/03/3006 1

(the numbers are just made up, just so u get the idea)

Any ideas? Thanks in advance!

RuralGuy
07-04-2008, 10:37 AM
What causes these records to be in any sort of order?