Du kan prøve:
DECLARE @HOURS decimal(7,4) = 20.5599
SELECT CAST(CONVERT(VARCHAR,DATEADD(SECOND, @HOURS * 3600, 0),108) AS TIME)
output :20:33:35
Men husk:Indtast tid i MSSQL kun under 24 timer
Hvis du vil have mere end 24 timer, prøv:
DECLARE @HOURS decimal(7,4) = 25.5599
SELECT
RIGHT('0' + CAST (FLOOR(@HOURS) AS VARCHAR), 2) + ':' +
RIGHT('0' + CAST(FLOOR((((@HOURS * 3600) % 3600) / 60)) AS VARCHAR), 2) + ':' +
RIGHT('0' + CAST (FLOOR((@HOURS * 3600) % 60) AS VARCHAR), 2)
output :25:33:35
-- Opdatering
Decimalminutter til mere end 24 timer
DECLARE @MINUTES decimal(7,4) = 77.9
SELECT
RIGHT('0' + CAST (FLOOR(COALESCE (@MINUTES, 0) / 60) AS VARCHAR (8)), 2) + ':' +
RIGHT('0' + CAST (FLOOR(COALESCE (@MINUTES, 0) % 60) AS VARCHAR (2)), 2) + ':' +
RIGHT('0' + CAST (FLOOR((@MINUTES* 60) % 60) AS VARCHAR (2)), 2);
output:01:17:54