ranking calculated fields in a query



the following select query adds 3 fields (R1 R2,R3) to create MPP. What I
need to do is add the code to Rank MPP within Level and Age Group. I have
tried several variations of code offered by others in responce to questions
in this news group but evidently I lack the skill level to insert samples
into my existing code.

SELECT [Twirlers].[First Name] & " " & [Twirlers].[Last Name] AS Name,
Fees.Level, ModelingXTab.[Age Group], Val(nz([MJ1R],0)) AS R1,
Val(nz([MJ2R],0)) AS R2, Val(nz([MJ3R],0)) AS R3, [R1]+[R2]+[R3] AS MPP,
"Some SQL" AS Rank
FROM (ModelingXTab INNER JOIN Twirlers ON ModelingXTab.[Twirler ID] =
Twirlers.[Twirler ID]) INNER JOIN Fees ON ModelingXTab.[Pagent ID] =
Fees.[Fee ID];

the results of this query should look like:

Mary Advanced 10-12 2 2 1 5 1
Jane Advanced 10-12 3 1 3 7 3
Sally Advanced 10-12 1 3 2 6 2

Beth Advanced 9-10 1 3 2 6 1
Jo Advanced 9-10 2 1 5 8 2
sue Advanced 9-10 4 2 4 10 3
Pat Advanced 9-10 5 4 1 10 3
Sam Advanced 9-10 3 5 3 11 5

Please note how ties are ranked.

Is it possible to rank the MPP field since it is a calculated field? In
some of the code I tried I got a 'circular reference' error on the table
name. One alternative I have considered is to change this select query to an
update query and have a seperate query to update the rank field but would
prefer to get the job done in one pass.

any help is appreciated
.



Relevant Pages

  • Re: ranking calculated fields in a query
    ... I needed to create 3 queries such as you reffered to as qRank. ... Each 'Rank' query uses the ... FROM (ModelingXTab INNER JOIN Twirlers ON ModelingXTab.= ...
    (microsoft.public.access.queries)
  • Re: ranking calculated fields in a query
    ... resolving the ties - I can't help any more with this. ... the rank to appear the way you need it. ... I will look at the other query and reply later. ... FROM (ModelingXTab INNER JOIN Twirlers ON ModelingXTab.= ...
    (microsoft.public.access.queries)
  • Re: ranking calculated fields in a query
    ... I needed to create 3 queries such as you reffered to as qRank. ... Each 'Rank' query uses the associated ... FROM (ModelingXTab INNER JOIN Twirlers ON ModelingXTab.= ...
    (microsoft.public.access.queries)
  • Re: Conversion of Rows into Colums
    ... If you have the data as you shown in the result, then you should be able to construct a pivot query. ... If you are saying you need an SQL statement to generate the rank based on ID and IDNew then the following should work ... Access MVP 2002-2005, 2007-2009 ... In the following I will count the records within the recordset related to the id. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Join query
    ... ranking query (where each distinct name is ... given a distinct "rank") then use the xtab method ... FROM tblGrade As t1; ... GroupNo Grader Points Rank ...
    (microsoft.public.access.queries)

Loading