DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: how do i convert milliseconds into hr:mi:ss format

  1. #1
    Join Date
    Jul 2001
    Posts
    9
    Hi,
    How do i convert milliseconds into hr:mi:ss format both in oracle and sqlserver.
    eg: i have 140000 milliseconds ,how can i convert that into hr:mi:s format.
    what is the query for this and is there a common query which works both for oracle and sqlserver database.
    I am using oracle 8x and sqlserver 2000.
    Thanks in advance
    kolli


  2. #2
    Join Date
    Jul 2001
    Posts
    1

    Smile In Oracle

    I dont know it this work in SQLServer, but in Oracle you can do:

    select to_char (to_date(round(140000/1000), 'SSSSS' ), 'HH24:MI:SS') AS HMS from dual;

    If you have more than 86399 seconds (seconds in a day) you must modify de sentence to detect that and add 24 hours to the result.

    Best regards.

    Ignacio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width