Convert minutes into seconds
SUM()
the seconds
Convert back to minutes
The following will give you the SUM of seconds:
SET @Seconds = SELECT SUM(DATEDIFF(SECOND, [START_TIME], [END_TIME]))
The following then turns that into a datetime
object:
select convert(varchar(8), dateadd(second, @Seconds, 0), 108)
Or as 1 query:
SELECT convert(varchar(8), dateadd(second, SUM(DATEDIFF(SECOND, [START_TIME], [END_TIME])), 0), 108)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…