Results 1 to 5 of 5
  1. #1
    cory.plowman is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Posts
    2

    Mltiple Group By concept?

    Okay guys, i'm fairly new at all this, so here's what I'm trying to do.

    I have a query that has the following fields:

    Date
    Task
    Task_Number (number of items completed for task)
    Employee


    I want to take that query and generate two reports that will tell me the following:

    1) Total number per task per date
    2) Individual number per task per employee per date

    The problem I'm running into is that each task can appear multiple times per day, as we have multiple employees assigned to each task. I don't want it to list each instance of task (which is what the report is doing now), but rather a total sum of Task_Number for each task each day.

    This is my current query for Total Task_Number per date:



    SELECT DISTINCT Data.date_id, Data.Task, Data.Task_num
    FROM Data
    GROUP BY Data.date_id, Data.Task, Data.Task_num
    ORDER BY Data.date_id;

    update: here is a screenshot of the report I'm working with, hopefully to illustrate my point.


  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    ok - well the first point to make is that one can aggregate at 2 different levels; you can do an aggregate query - and make a report based on that - or - you can aggregate with the report itself.

    Not a right or wrong - just a matter of what you want.

    When you aggregate in a report - that is in the group footer. Most people want to see the detail section. If you do not - then make that section not visible.

    Hope it helps.

  3. #3
    cory.plowman is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Posts
    2
    I thought that's what I had been doing, but am I doing it wrong? I want it grouped by date, then by task, then to SUM the task_number line according to the Task grouping.


  4. #4
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    and so looking at your added data:
    8/8/11 Stretch = 16 right?

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Do the grouping in the Report's SORTING AND GROUPING, not in the query.

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

Similar Threads

  1. Cumulative Limit Concept
    By Bedsingar in forum Access
    Replies: 5
    Last Post: 07-29-2011, 06:32 AM
  2. Contract letter concept
    By siktir23 in forum Access
    Replies: 3
    Last Post: 07-22-2011, 12:07 PM
  3. Report Concept
    By BLD21 in forum Reports
    Replies: 1
    Last Post: 07-03-2011, 09:44 AM
  4. Concept Forms
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-31-2010, 01:51 AM
  5. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 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