hello experts,
i m looking for a time difference between 2 data excluding the overlap period.
declare @tbl table(id int, startTime datetime, endTime datetime) insert into @tbl values (1, '12/31/2014 09:00:00', '1/3/2015 09:00:00') insert into @tbl values (2, '12/31/2014 09:00:00', '1/2/2015 09:00:00')
in above example, the overlap period is from '12/31/2014 09:00:00' to '1/2/2015 09:00:00'.
hence time difference excluding overlap period is from '1/2/2015 09:00:00' to '1/3/2015 09:00:00' = 24 Hrs.
how to calculate this? data can be anything, the above data is just to put my issue explanation. thanks!