Results 1 to 6 of 6
  1. #1
    mfarley is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    3

    Aggregating Data

    Hi there,
    I'm new to access so please bear with me. I have a table with my customer name (text), the date they used the service (date), how many hours (number) they used and if they paid (yes/no). What I'd love is to get a query to give me a total number of paid and unpaid hours used for a given month for each customer.
    So it would look like this:

    customer name Paid Hours Unpaid Hours
    customer X 5 10
    customer Y 4 3
    customer Z 5 0

    I've used expressions within the query and got this:

    customer name Paid Hours Unpaid Hours
    customer X 5 0
    customer X 0 10
    customer Y 4 0
    customer Y 0 3
    customer Z 5 0



    I've tried making an unpaid query and a paid query for a given month and then trying to union the two -- which failed miserably.

    I'm sure this is straightforward and I'm just missing something. Some help would be greatly appreciated.

    Thanks!!!

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Take a look at Aggregate (Totals) Queries in Access's help files. You can group on your Customer Name and Month, and Sum your Paid and Unpaid Hours fields.

  3. #3
    mfarley is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    3
    Hi JoeM,
    Thanks for the response. I don't have a paid and unpaid hours fields. I just have an hours field and a check box for if the hours were paid or not. Do you have any other suggestions?

    Thanks again!

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I don't have a paid and unpaid hours fields. I just have an hours field and a check box for if the hours were paid or not.
    I thought you said you already created expressions to get this.
    I've used expressions within the query and got this:
    You can create a new Aggregate query based on that query, and sum on your calculated expressions.

  5. #5
    mfarley is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    3
    Sorry - I misunderstood you. And *yay* it worked great. Thanks again for all your help!

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Glad it worked out for you!

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

Similar Threads

  1. Replies: 1
    Last Post: 12-21-2011, 02:11 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