Converting Seconds Into HH:MM:SS Format Using SQL Server January 13, 2014 Get link Facebook X Pinterest Email Other Apps DECLARE @Seconds INT SET @Seconds = 90 SELECT REPLACE(STR(@Seconds / 3600, LEN(LTRIM(@Seconds / 3600)) + ABS(SIGN(@Seconds / 359999) - 1)) + ':' + STR((@Seconds / 60) % 60, 2) + ':' + STR(@Seconds % 60, 2), ' ', '0') AS TIME Output: 00:01:30 Comments
Comments
Post a Comment