Results 1 to 2 of 2
  1. #1
    TommyC is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    1

    **ASAP** Sum of Query Expression Grouped by Employee Number

    Here is my assignment details.

    List the employee number, name, total amount of commissions on orders taken in January 2007. The amount of commission is the sum of the dollar amount of products ordered times the commission rate of the employee.

    I can't get the commission to total by EmpNo, FirstName, or LastName without an aggregate function error. What am I doing wrong?

    This is my current progress:




    and the result... The result on the left is what I'm getting, the result on the right is what I should be getting.


  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Note: providing assignment help is not a requirement to be a contributor here.

    It's disheartening to read "ASAP" in the title of a thread. You'll get more appreciation by not doing it.

    You need to GROUP BY every field that is not your calculation. you're getting the error mostly because of that reason. Do you understand GROUP BY clauses? How about aggregations?

    with the number of fields you have there in design view, grouping your query with just one calcuated field in it will yield you incorrect results again. Be aware that using a GROUP BY clause will yield the calculation you've specified for every DISTINCT ROW, not Employee numbers.

    for example, if you group by every field in your query like Access requires, the way you have things now, you'll get this:

    Code:
    employee 1 | order 1 | commission: $1.34
    employee 1 | order 2 | commission: $4.39
    
    etc, etc...
    Only include fields that are not calculations in which the combination of them will always be the same for each employee ID. make sense?

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

Similar Threads

  1. Search Fields Queastion NEED HELP ASAP
    By Nelson12 in forum Access
    Replies: 9
    Last Post: 03-29-2010, 11:04 AM
  2. Query to Average on Grouped Fields
    By randolphoralph in forum Queries
    Replies: 1
    Last Post: 03-16-2010, 08:03 PM
  3. Sum problem for query expression
    By Stanggirlie in forum Access
    Replies: 3
    Last Post: 09-18-2009, 05:54 AM
  4. Help me asap... I need this for my exam
    By freelance_jhoe26 in forum Access
    Replies: 1
    Last Post: 04-20-2009, 02:30 PM
  5. Query help needed asap!!
    By msaccess09 in forum Queries
    Replies: 1
    Last Post: 02-25-2009, 09:39 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