Click here to Skip to main content
15,887,344 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SELECT TOP (200) Emp_ID, ProxyNo, EmpName, JoiningDate, Dept_Name, Designation, Emp_Type, Atten_date, OriginIntime, EIntime, EOutTime, Status, Shift, Overtime, OutTimeCal, TotOT, RealOT, EOT, MorOT, 
TimeDedu, SDate, EDate, PDay, AbDay, CLDay, ELDay, SLDay, WDay, FDay, WorkHrs, Pstatus, Section, Unit_Name, SubSection, ComID
FROM   Temp_JobCard
WHERE        (RealOT = 1.50)




Here I want to show 1.5 = 01:30 that means, if the result is 1.5 it will show me 01:30 .Same as 1.25= 01:15. Basically i need to show time,hour to convert this numeric number.

What I have tried:

SELECT CONVERT(datetime,REPLACE('1.5','.',':')) 


My output is
1900-01-01 01:05:00.000
But its not correct.

But I need output is
01:30<pre>
Posted
Updated 27-Feb-17 20:08pm

1 solution

A simple google would have found you this: it did me.
convert float to hours and minutes in sql - Google Search[^]

The top link (and all the other 198,000 links) will give you a solution: sql server - SQL: float number to hours format - Stack Overflow[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.
 
Share this answer
 

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