G
Guest
I am trying to add a ranking expression to my via via subquery. Searching the
forums I have come up with the following but all ranks equal 1.????
The field ASXCode is a name, Traded_12mth is a numeric field and is the
basis on the rank.
The rank should be descending.
Also when there is a tie it should count like as follows;
100 1
200 2
200 2
300 3
Rgds,
Bruce
SELECT ASXCode, Traded_12mth,
(SELECT Count(*)
FROM tbl_MCR_Stats AS X
WHERE X.ASXCode = tbl_MCR_Stats.ASXCode
AND X.Traded_12mth <= tbl_MCR_Stats.Traded_12mth) AS rank
FROM tbl_MCR_Stats
forums I have come up with the following but all ranks equal 1.????
The field ASXCode is a name, Traded_12mth is a numeric field and is the
basis on the rank.
The rank should be descending.
Also when there is a tie it should count like as follows;
100 1
200 2
200 2
300 3
Rgds,
Bruce
SELECT ASXCode, Traded_12mth,
(SELECT Count(*)
FROM tbl_MCR_Stats AS X
WHERE X.ASXCode = tbl_MCR_Stats.ASXCode
AND X.Traded_12mth <= tbl_MCR_Stats.Traded_12mth) AS rank
FROM tbl_MCR_Stats