StartedOn
EndedOn
declare @baseDate datetime = '2016-01-01' select RunTime = convert(varchar(10), datediff(minute, StartedOn, coalesce(EndedOn, getutcdate())) / 1440 ) + 'd, ' + convert(varchar(30), dateadd(second, datediff(SECOND, StartedOn, coalesce(EndedOn, getutcdate())), @basedate), 8) from dbo.MyTable
1d, 22:06:33
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.