Results 1 to 3 of 3
  1. #1
    Can5er is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    2

    Sum Data Based on Date Field

    Hello,

    I have several related tables in my report, but need to add a calculation for several of the fields based on a date. The data includes a date as mm/dd/yyyy and then three additional fields with bonus payments, vacation hours and vacation payments. I want to be able to sum the bonus and vacation information by year. This is part of a much larger report that includes much information about specific employees over a three year period. The data I am trying to sum looks like this:

    PPE Bonus_Pay Vac_Hrs Vac_Earn


    1/10/09 1212.00 8 532
    4/21/09 834.00 8 532

    Similar entries for a three year period.

    I tried grouping but the result tripled the summed numbers. I am a newbie and am certain it is operator error, but this operator is out of solutions. I appreciate any assistance.

  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,641
    How about a query:

    SELECT Year(PPE) As YearOfData, Sum(Bonus_Pay) As TotalBonus, Sum(Vac_Hrs) As TotalVacHours, Sum(Vac_Earn) As TotalVacEarn
    FROM TableName
    GROUP BY Year(PPE)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Can5er is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    2
    Thanks. I will try that approach, but "novice" does refer to my Access experience as well as my posting history.

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

Similar Threads

  1. Running Total Based on a Date in a field
    By scratchmb in forum Access
    Replies: 4
    Last Post: 02-15-2012, 05:31 PM
  2. Changing tables based on field date
    By dssrun in forum Programming
    Replies: 6
    Last Post: 07-10-2011, 10:17 AM
  3. Replies: 1
    Last Post: 03-01-2011, 04:03 PM
  4. Replies: 1
    Last Post: 02-06-2011, 06:36 PM
  5. Field content based on date calculation
    By jlmnjem in forum Programming
    Replies: 6
    Last Post: 09-23-2010, 10:24 AM

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