
Signature
KARL DEWEY
Build a little - Test a little
> Below is the SQL for a query that I have. Below the SQL is the results. What
> I need to do is rank the score by each name in descending order. When the
[quoted text clipped - 26 lines]
> Plant C 2004 widget 111 5
> Plant C 2004 widget 111 5
Thanks for the reply. When I ran this SQL it gave me a syntax error with the
following:
>SELECT Q.Name, Q.DefectCode, Q.Score, (SELECT COUNT(*) FROM Plant Q1
> WHERE Q1.[Name] = Q.[Name]
> AND Q1.Score > Q.Score)+1
Everything I tried did not correct the error.
Please le me know if you see where the syntax error is.
Thanks again.
>Try this --
>SELECT Q.Name, Q.DefectCode, Q.Score, (SELECT COUNT(*) FROM Plant Q1
[quoted text clipped - 8 lines]
>> Plant C 2004 widget 111 5
>> Plant C 2004 widget 111 5
Smartin - 10 Nov 2007 22:58 GMT
> Thanks for the reply. When I ran this SQL it gave me a syntax error with the
> following:
[quoted text clipped - 24 lines]
> --
> Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200711/1
Prolly needs a closing paren before "AS Rank":
SELECT Q.Name, Q.DefectCode, Q.Score, (SELECT COUNT(*) FROM Plant Q1
WHERE Q1.[Name] = Q.[Name]
AND Q1.Score > Q.Score)+1 ) AS Rank
FROM Plant AS Q
ORDER BY Q.Name, Q.Score DESC;