I'm trying to convert a date field that is set up as an integer to a regular time format. For instance, the current output for the field is 66600 which is really 6:30Pm. How can I make it output the time as 6:30 PM?
select cast(left(convert(decimal(10,2),times)/3600,2)%12 as varchar)+':'+
left(cast(round(cast(right(convert(decimal(10,2),times)/3600,8)as money)*60,0) as varchar),2)
+' PM'
as float from e
e is tablename
times is the column which has value like 66600
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.