Results 1 to 5 of 5
  1. #1
    MFS is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235

    Add overtime totals from 1st of the year to present

    Hello,
    For some reason I cannot get this figured out, I'm looking to have a query return total overtime hours that each employee has worked through the year, starting with 1/1/2015.
    The fields in the Query are . . .


    • Period Ending, (Pay period end date, Typically every Sunday)
    • Total Overtime Hours Worked, (How many hours over the employee worked during that period)
    • Employee_Id


    Example: Kelly Smith 3
    Dave Hart 22
    Scott Davidson 17

    What I'm getting is . . .
    Kelly Smith 2
    Kelly Smith 1
    Dave Hart 20
    Dave Hart 2
    Scott Davidson 10
    Scott Davidson 17

    Hope someone can help,

    Speck

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I suspect you are grouping on the period. It should just be Where, not Group By.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    MFS is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235
    Got it,
    I removed Period_Ending from the Query and Summed Total Overtime Hours Worked.
    I feel like a marooon.

    Thanks all

  4. #4
    MFS is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235
    pbaldy, I can look into that scenario as well.

    Thank You

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If you want to filter on the period, you have to leave it in the query, but with Where in the totals row. In SQL view, that would take it out of the SELECT and GROUP BY clauses but leave it in the WHERE clause (or HAVING).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-27-2015, 11:46 AM
  2. Calculating overtime pay
    By mallard09 in forum Queries
    Replies: 3
    Last Post: 09-12-2014, 08:27 PM
  3. Month totals and Year totals
    By marksnwv in forum Access
    Replies: 1
    Last Post: 08-05-2011, 10:13 AM
  4. Overtime Tracking
    By cpl_usmc in forum Access
    Replies: 1
    Last Post: 06-07-2011, 03:59 AM
  5. Code for calculating employees overtime pay
    By Nixx1401 in forum Access
    Replies: 17
    Last Post: 05-05-2011, 05:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums