If you only care about times you can also do a kludge like this
create table timespan(startime int,endtime int)
insert into timespan
select 1629 , 1630 union all
select 751 , 800 union all
select 1521 , 1530 union all
select 1123 , 1130 union all
select 1133 , 1145 union all
select 1147 , 1200
select startime org_time,endtime due_time,
case when (endtime-startime) - 40 < 0 then
endtime-startime else (endtime-startime) - 40 end mins
from timespan
âI sense many useless updates in you... Useless updates lead to fragmentation... Fragmentation leads to downtime...Downtime leads to suffering..Fragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" --
http://sqlservercode.blogspot.com/