select sum(TotalSeconds) / 3600 as Hours, (sum(TotalSeconds) % 3600) / 60 as Minutes, sum(TotalSeconds) % 60 as Secondsfrom(select ArrivalTime, DepartureTime, DateDiff(second, ArrivalTime, DepartureTime) as TotalSeconds from SSRwhere CustomerID = 10) xThanks to this site for the heads up.
Monthly Archive: January 2008
Permanent link to this article: http://ramblinggeek.co.uk/2008/01/t-sql-calculate-hours-mins-and-secs-from-starttime-and-endtime/


