Convert number to time

  • 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.

     

  • 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.

  • Thank you David.. it works ...

  • 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