Click here to Skip to main content
15,914,162 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to convert decimal to HH.MM format in SQl Server. Example:- 06.85 will be converted to 07.25, 05.60 will be converted to 06.00
Posted
Updated 21-May-13 23:08pm
v2

Try this...
SQL
declare @d decimal(18,2)
set @d=06.85
select @d = case when (100*(@d- floor(@d)))>59 then floor(@d)+1 else floor(@d) end + floor((100*(@d- floor(@d)))% 60)/100
select @d

Happy Coding!
:)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900