Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Location
    oo
    Posts
    1

    Unanswered: Time Calculation in oracle

    Hi All
    Please I want to know how can I Calculate the duration between tow times for Example I've employee Start work 08:30: and end work 05:50
    how can i get the real work hours for this employee?
    please
    thanks

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Time Calculation in oracle

    Originally posted by ahmedmorgan
    Hi All
    Please I want to know how can I Calculate the duration between tow times for Example I've employee Start work 08:30: and end work 05:50
    how can i get the real work hours for this employee?
    please
    thanks
    Try use math (i believe that you was in school)
    It this will not help you then try use search in this forum for similar posts.

  3. #3
    Join Date
    Apr 2002
    Posts
    56
    You can acutally substract one dat from another date.
    The result is in days, so multiply by 24 and you've got hours.

    example

    SELECT SYSDATE - to_date('01-01-2004','DD-MM-YYYY') from dual;

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Time Calculation in oracle

    When you subtract 2 dates in Oracle you get a result expressed in days. In your example, the difference between 08:30AM and 05:50PM on the same day is 9 hours and 20 minutes, which is equivalent to 0.3888888888 days, so that is what Oracle will tell you if you select end-start. You can easily conver to hours by multiplying by 24, and so on.

Posting Permissions

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