Solved Ranking Query

CvlENGR

New member
Local time
Today, 02:10
Joined
Sep 29, 2023
Messages
1
I am just beginning in Access so i'm learning as I go.

I have a table "Truck Table" that I am trying to Query to rank the inventory using year model and mileage. I have found the following code on another posting that seemed to fit my application and worked for them:

SELECT
T2.Model,
1 +
(
SELECT
COUNT(*)
FROM
(
SELECT DISTINCT
Model
FROM [Truck Table]
) AS T1
WHERE
T1.Model > T2.Model) AS Rank
FROM
[Truck Table] AS T2
ORDER BY
T2.Model DESC

When trying to run the query, it is giving me this error:

1696003212199.png


I'm not sure where to go from here. Thank you in advance for your help.
 
Have a look at my approach to ranking in queries:
 

Users who are viewing this thread

Back
Top Bottom