This is a discussion on Time Function? within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi How can I convert integer to time . Ex: number = 91 Result = 1h 31m Something like ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| This seems to be about formatting a value for display so I suggest you do that client-side rather than in the database. SQL Server doesn't have a TIME datatype so your time will have to include a date as well. You can just ignore the date unless the time value exceeds 86400 (24 hrs) in which case your "time" value will then no longer make sense without a value in days as well. I'll assume that isn't a problem for you. Try: DECLARE @i INTEGER SET @i = 91 SELECT DATEADD(mi,@i,0) -- David Portas SQL Server MVP -- |