View Single Post
Old December 12th, 2005, 08:41 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Actually, you asked to show the relative "size of data", not the descending order of each person by age ("i need to do a ranking between all the persons by age.")

However, that would look like:


But would not look like:

David 1
Shelly 1
Noam 2
Gili 3

In fact, it would look like this in a report where you added a number column (you wouldn't necessariy add this in the query results):

David 1
Shelly 2
Noam 3
Gili 4

I am thinking the only way to add this would be through code. You would have to do a query just on the age field first, and then select Unique Values = Yes. Order By Age DESC. Then you could add a number column to rank them. I am not sure how to do this other than to create a table called tblAgeRank with two fields, Age and Rank.

Then do a DELETE query on the table, then do an APPEND query, which would be the query in the last paragraph, and put the rank in with that query.

Then do a thrid query that matches the original table data (Name field, Age field) against tblAgeRank Age field, and then add the Rank field to your query.

Kind of the long way around. I could code this. I am sure another poster has a more elegant solution.