Y
Yakimo
Hi!
I have a very large table, containing some DateTime data.
Is it possible to run a query that will return a resultset, containing the
difference between my DataTime values in two adjacent rows?
Example:
ID OnOff TID DateTime
-------------------------------------
1 On 1 11:30:30
2 On 2 11:30:35
3 Off 1 11:35:30
4 Off 2 11:45:35
I want to get a recordset, containing the between Off time and On time for
particular TID, like this:
TID Duration
---------------------------
1 0:05:00 (11:35:30-11:30:30)
2 0:15:00 (11:45:35-11:30:35)
Can this be done with SQL query?
I can do this iterating in a loop, but it seems to slow and clumsy...
I 'd appreciate any help.
Thanks,
Yakimo
I have a very large table, containing some DateTime data.
Is it possible to run a query that will return a resultset, containing the
difference between my DataTime values in two adjacent rows?
Example:
ID OnOff TID DateTime
-------------------------------------
1 On 1 11:30:30
2 On 2 11:30:35
3 Off 1 11:35:30
4 Off 2 11:45:35
I want to get a recordset, containing the between Off time and On time for
particular TID, like this:
TID Duration
---------------------------
1 0:05:00 (11:35:30-11:30:30)
2 0:15:00 (11:45:35-11:30:35)
Can this be done with SQL query?
I can do this iterating in a loop, but it seems to slow and clumsy...
I 'd appreciate any help.
Thanks,
Yakimo