mauliks1990 (3/18/2015)
how to convert float to timestamp in single select queryfor exp. i have float as 1.251152515236 ,
i want to convert this to datetime and from datetime to timestamp... i.e. 26:11:00
26:11:00 is not a valid time. If you haven't noticed yet, there are only 24 hours in a day.
To format it with the days seperately:
DECLARE @dectime float = 1.251152515236;
SELECT CONCAT(FLOOR(@dectime),' days ',CONVERT(TIME(0),DATEADD(SECOND,(@dectime - FLOOR(@dectime)) * 86400,0)