Adding Times in a Query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Drum2001

    #1

    Adding Times in a Query

    I am running a query to calculate overtime:

    SELECT [DateFilter - Admin].Employee, [DateFilter - Admin].TimeTypeIn,
    sectodur(IIf(Su m(DateDiff("s",[clockin],[clockout]))-40*60*60>0,Sum( DateDiff("s",[clockin],[clockout]))-40*60*60,0))
    AS Overtime, DateAdd("d",-Weekday([ClockInDate]),[ClockInDate])+1 AS
    WeekOf
    FROM [DateFilter - Admin]
    GROUP BY [DateFilter - Admin].Employee, [DateFilter -
    Admin].TimeTypeIn, DateAdd("d",-Weekday([ClockInDate]),[ClockInDate])+1
    HAVING ((([DateFilter - Admin].TimeTypeIn)="R egular"));


    This will come up with a recordset similar to below:

    Employee TimeTypeIn Overtime WeekOf
    B.Smith Regular 0:04:55 3/12/2006
    B.Smith Regular 0:00:00 3/19/2006

    Now, what I need to do is find the sum of the two Overtime Records
    (0:04:55+0:00:0 0). This sum will then be put on a report. This can be
    done within this query, another, or any other method if need be. Any
    suggestions on how this may be completed? I Thank you for any
    assistance!

    ~Drum2001

Working...