473,503 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rank ordering records in dynaset

1 New Member
Here is an Access question for you.

Say I have a table of people’s weights and their names:

Joe 150
Pete 160
Dave 165

I can make a query than sorts in descending order:

Dave 165
Pete 160
Joe 150

No problem. But what if I want to assign a score based on weight. I.e. the highest weight gets the highest score. So, my output would be:

Dave 165 1
Pete 160 2
Joe 150 3

How do I get the scores in a calculated field? Is that possible in Access?
Oct 22 '08 #1
1 1496
NeoPa
32,557 Recognized Expert Moderator MVP
You can do it with subqueries (Subqueries in SQL) :
Expand|Select|Wrap|Line Numbers
  1. SELECT Name,
  2.        Score,
  3.        (SELECT Count(Name)
  4.         FROM tblTest3 AS sT3
  5.         WHERE sT3.Score>tT3.Score)+1 AS Pos
  6.  
  7. FROM tblTest3 AS tT3
Oct 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2378
by: Ken Fine | last post by:
(originally posted to one of macromedia's groups; no help, so hopefully someone here can help me out. I'm using VBScript ASP.) When designing administrative interfaces to websites, we often need...
9
2861
by: MLH | last post by:
I have a database (datatrek.mdb) with a table named DATA. The table has a date/time field with default value = Now(). It has 100 records in it entered over a 50-minute period. I would like the...
2
1475
by: MLH | last post by:
I feel pretty lucky on my last SQL question. I think I'll try one more... If there is a table (tblCorrespondence) with a field in it named and I am extracting a dynaset of records having an ...
4
1531
by: Chris | last post by:
Any good routines or suggestions to assist me in re-ordering my records in my datagrid? i.e. I have a field in each record that is used for ordering (i.e. 1,2,3,4). I would like to implement a...
1
448
by: JG | last post by:
I have an Access 2000 database with a query in it that is pulling data from a table that has duplicate records in it. It is doubling my currency out put. To get rid of the duplicate records in the...
3
6538
by: max | last post by:
Let's say I have a table with the following fields. State, Customer, and Total Sales. What I want to do is rank each customer by sales volume by state. i.e. highest sales is ranked 1, second...
2
2936
by: orenlevy1 | last post by:
Hi Everyone. I have a problem that I could not figure out what to do with it. I have a couple of tables and views. All have the same unique ID. When a user try to do a search on our web site...
7
1891
by: MLH | last post by:
But now here's the catch - I want to see information from an earlier record in the table. Suppose the correspondence table had these five records ID VehicleJobID OutDate OutType 1 ...
9
4135
by: rjshrader | last post by:
I have a table (tblStatus) with three fields (CustomerID, StatusType and StatusDate). I use an unbound form with three text boxes to enter data into the table when a command button (cmdSave) is...
3
8071
by: gismar | last post by:
hi! i'm at a loss here. after creating my form, I added data to it and the next time I started access, it did not show any of the records- they are still in the table but are not shown!! I...
0
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.