August 29, 2019 at 12:00 pm
How to convert number to time
I have set of numbers in row and want to convert into time. Currently i am using in oracle numtodsinterval.
Number = 626400
select TO_CHAR (trunc(sysdate) + NUMTODSINTERVAL ((626400 -432000)/10, 'second'), 'hh24:mi:ss') from dual
Output: 05:24:00
now to convert the values in sql
number = 626400
In Sql how to do it.
August 29, 2019 at 12:49 pm
Don't know Oracle but if the result of your math is number of seconds since midnight then
CAST(DATEADD(second,(626400-432000)/10,0) as time)
Far away is close at hand in the images of elsewhere.
Anon.
August 29, 2019 at 12:57 pm
Thank you David.. it works ...
August 29, 2019 at 1:08 pm
Just make sure the number of seconds does not exceed one day otherwise the time will be wrong
Far away is close at hand in the images of elsewhere.
Anon.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply