Do more with
select [counter], [hours], [days]
, dateadd(HH,
(select sum([hours]) from your_table b where b.counter <= a.counter),
'2011-05-12 06:00:00') [end date/time]
from your_table a;
select [counter], [hours], [days]
, dateadd(MI,
(select sum([hours]*60) from your_table b where b.counter <= a.counter),
'2011-05-12 06:00:00') [end date/time]
from your_table a;
select [counter], [hours], [days]
, convert(datetime, '2011-05-12 06:00:00')
+ (select sum([days]) from your_table b where b.counter <= a.counter) [end date/time]
from your_table a;
Premium Content
You need an Expert Office subscription to comment.Start Free Trial