Results 1 to 4 of 4
  1. #1
    Gabriel2012 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Nov 2012
    Posts
    31

    Post Query Help: Averages per user and period


    Greetings, I have a table with multiple fields, those which are relevant for my query are listed below. I need to create a query that determines the average score for each user by period. Below is an example of my intended outcome, any help is appreciated, thank you.

    Example Table layout:
    LastName, Period (month), Score

    Bob 1 100
    Bob 1 50
    Bob 1 100
    Jim 2 100
    Jim 2 50
    Jim 2 100

    Expected Query Result:
    LastName, Period (month), Score Average

    Bob 1 75
    Jim 2 75

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You need an aggregate query. The SQL text would look like this

    SELECT lastname, period, Avg(Score)
    FROM tablename
    GROUP BY lastname, period

    If you are using the design grid view, you would add the three fields and then right click the column with the score field; select Totals. In the Totals row of the grid, change the Group By for the score field to Average.

  3. #3
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Here is a SQL statement. Change field names and table names to yours.
    Code:
    SELECT Scores.FName, Scores.Period, Avg(Scores.Score) AS AvgOfScore
    FROM Scores
    GROUP BY Scores.FName, Scores.Period;

  4. #4
    Gabriel2012 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Nov 2012
    Posts
    31
    Bravo, thank you.

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

Similar Threads

  1. Query for Specific 24 hour time period
    By esh112288 in forum Queries
    Replies: 1
    Last Post: 10-23-2012, 02:16 PM
  2. One MS Access Query - Multiple Averages?
    By ajcke in forum Queries
    Replies: 9
    Last Post: 05-09-2012, 07:16 AM
  3. Query to show averages by month
    By DDEB in forum Queries
    Replies: 3
    Last Post: 05-08-2012, 05:11 PM
  4. Replies: 23
    Last Post: 06-30-2010, 02:05 PM
  5. Query showing averages for groups
    By AnthonyTesta in forum Queries
    Replies: 1
    Last Post: 02-03-2010, 09:04 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