Pls help, urgent need to know how..

H

howren

I can list records of grades using the report generator.
Simple, but I have a problem to show who is number 1,2,3
and so on without sorting.

If ms excel, that is easy; one simply rank the column
involved and done. But I need to make everything in ms
access and not part excel and then go to access. Any idea
how to implement this in access. Much appreciated.
Please send to (e-mail address removed)

I mean like this

NAME GRADE POS
 
K

Ken Snell

Well, let me see if I get you started with how to calculate a rank in a
query, and then you can work with the criteria and ordering to get the
desired result.

What you want is to create a calculated field (call it Ranking) in the
query, where this calculated field uses a subquery to return the ranking
number:

POS: (SELECT COUNT(*) FROM TableName AS T WHERE T.Grade <
TableName.Grade) + 1

In the above, TableName is the name of the table that contains the data; and
Grade is the field name that you show as GRADE. Note that it is not a good
practice to use NAME as the name of a field in a table. Name is a reserved
word in ACCESS (it's a property of most objects) and you can confuse ACCESS
when you start using it as a field or control name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top