Results 1 to 6 of 6
  1. #1
    nerd__ is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Toronto, Canada
    Posts
    3

    Aggregate Query - Need Help

    Hi guys,



    Newbie here, but hoping to learn lots. I'm currently working on a project where I'm trying to aggregate some data in MS Access and need help with my query. This is my query as it looks now:

    Code:
    PARAMETERS [Forms]![Dialog - Hours by Resource]!cmbProject.[Value] Text ( 255 );
    TRANSFORM Sum([ChangePoint Sample Data].Hours) AS SumOfHours
    SELECT [ChangePoint Sample Data].Resource, [Resource List].Role, Sum([ChangePoint Sample Data].Hours) AS [Grand Total]
    FROM [ChangePoint Sample Data] INNER JOIN [Resource List] ON [ChangePoint Sample Data].[Resource] = [Resource List].[Resource]
    WHERE ((([ChangePoint Sample Data].Project)=[Forms]![Dialog - Hours by Resource]![cmbProject].[Value]))
    GROUP BY [ChangePoint Sample Data].Resource, [Resource List].Role
    ORDER BY [Resource List].Role
    PIVOT [ChangePoint Sample Data].Month;
    This is the output, the resource column actually has names but I have changed it for privacy reasons:

    [Please see 'Hours by Resource Output' in my attached ZIP]

    What I would like to have it look like is this:

    [Please see 'Desired Output' in my attached ZIP]


    How can I achieve my desired output? Either by modifying my query or using another tool in Access.
    Any input is appreciated and excited to be part of the community!
    Attached Files Attached Files

  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 think the easiest way to get that look is to base a report on your existing query, and in the Sorting and Grouping area set up Role as a field to be grouped on. If you use the wizard, it will ask about grouping fields.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    nerd__ is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Toronto, Canada
    Posts
    3
    Ok, so I was able to get the look but I can't get my summary details (eg. Total NumOfHours for Developers). Any thoughts?
    Attached Thumbnails Attached Thumbnails Snapshot.JPG  

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You want to select the option to view group header/footers and put a formula like this in a textbox:

    =Sum(FieldName)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    nerd__ is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Location
    Toronto, Canada
    Posts
    3
    pbaldy, thank you! I finally got it to look the way I want
    Am I able to mark this thread as solved or do the mods have to do it?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help! You can mark it solved in Thread Tools at the top of the thread.
    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. Aggregate query issue
    By TheShabz in forum Queries
    Replies: 8
    Last Post: 09-06-2011, 05:09 PM
  2. Aggregate Query
    By DonL in forum Queries
    Replies: 1
    Last Post: 08-04-2011, 09:54 AM
  3. Help in aggregate query
    By somm in forum Queries
    Replies: 1
    Last Post: 02-15-2011, 10:18 AM
  4. Aggregate Query Returns No Values
    By Xiaoding in forum Queries
    Replies: 6
    Last Post: 03-29-2010, 02:01 PM
  5. Using an Aggregate in a query
    By jbh02 in forum Queries
    Replies: 0
    Last Post: 09-15-2009, 07:29 PM

Tags for this Thread

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