calculation between current and previous line

  • Thread starter Thread starter Nevio
  • Start date Start date
N

Nevio

Hi,
I've a report in wich each line has a date; I have to
calculate the time difference between the previous line
and the current and put it on the current line.
Anyone has an idea on how can I manage to do that?
Many thanks in advance.
 
You can do this in your query by using a subquery.
SELECT MyTime, MyTime - (SELECT Max(MyTime) FROM tblA A WHERE
A.MyTime<tblA.MyTime) as TimeDiff
FROM tblA;
 
Back
Top