Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2012
    Posts
    97

    Unanswered: Top N Values per Group Query

    Dear all,

    Using Access 2000.

    I am having problems getting a query to give me the data I am after. I have a simple table with 4 fields.

    ID: Autonumber
    PlayerID: Numeric
    TestID: Text
    Score: Numeric

    There are 6 tests which players can take. Players scores in the tests are recorded (3-8). Players are able to take the test multiple times and their scores are always recorded.

    I am looking for a query that will give me the highest two scores for each player in each different test bearing in mind that on occasions players may only have one score for a particular test.

    I have used the guidance from the following source (ACC: How to Create a Top N Values per Group Query) but I get the following error message when I attempt to run the query.

    Run time error 13: Type mismatch

    I have attached a small sample file if that is of any assistance.

    Many thanks in advance for any help you can offer,

    Dave
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2012
    Posts
    97
    Have managed to find a solution to the above problem. There was an issue with the way I dimensioned the recordset object.

    Apologies for any time wasted.

    Dave

  3. #3
    Join Date
    Nov 2010
    Posts
    84
    You have an example that the solution using the select command "top X records per category.rar" at the link in my signature

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •