Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 float to interget

Author  Topic 

gavakie
Posting Yak Master

221 Posts

Posted - 2013-08-30 : 14:08:49
I have a field
1700 its a float. I need that converted to time.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2013-08-30 : 16:04:54
SELECT DATEADD(MINUTE, Col1 % 100, DATEADD(HOUR, Col1 / 100, 0))



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2013-08-30 : 16:12:52
Or easier,
SELECT CAST(DATEADD(MINUTE, (Col1 / 100) * 60 + (Col1 % 100), 0) AS TIME(0)) AS theTime




Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page
   

- Advertisement -