Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    46

    Unanswered: Calculating Time Interval

    Hi,

    I have the input parameter of employee in & out as follows:

    Intime:=10/01/2009 9:30:00 AM
    outtime:=10/01/2009 6:30:00 PM

    I want to calculate the Employee Over time working houre.
    and i am using below script for the same but i am not getting correct result .

    can any one tell me is there any finction available in oracle which will return the difference of intime & outtime with accurate result.

    (FLOOR((tio.OutTime -tio.InTime)*24*60)-30) > (FLOOR((t.OutTime -t.InTime)*24*60)) THEN TO_CHAR(FLOOR((FLOOR((tio.OutTime -tio.InTime)*24*60)-30)-FLOOR((t.OutTime -t.InTime)*24*60))/60,'FM00') ||':'|| TO_CHAR(MOD(((FLOOR((tio.OutTime -tio.InTime)*24*60)-30)-FLOOR((t.OutTime -t.InTime)*24*60)),60),'FM00') END AS OverTime,

    Regard's
    prasad

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by prasadtiwari View Post
    can any one tell me is there any finction available in oracle which will return the difference of intime & outtime with accurate result.
    Just do outtime - intime

    If those two parameters are DATEs you'll get back the number of days.
    If those two parameters are TIMESTAMPs you'll get back an INTERVAL that represents the difference in days, minutes, seconds and milliseconds.

Posting Permissions

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