Declare @intSeconds int
Set @intSeconds = 99999999
SELECT
Total_Duration = CONVERT( VARCHAR, RIGHT('00000' + RTRIM(@intSeconds/3600), 5)
+ 'hrs ' + RIGHT('00' + RTRIM((@intSeconds % 3600) / 60), 2)
+ 'mins ' + RIGHT('00' + RTRIM((@intSeconds % 3600) % 60), 2)
+ 'secs ')
Comments