I am trying to produce the following format which can then be exported into a graphing program:
----Date1------ ---Date2-------
Rank Type Total Type Total
My starting point is qryTotals:
qryTotal
Date Total Type
Date1 2 x
Date1 6 y
Date1 3 z
Date2 20 x
Date2 5 y
Date1 10 z
I'm fairly sure the first step is to generate the following query which ranks Total within each Date:
qryRank
Date Total Type Rank
Date1 2 x 1
Date1 3 z 2
Date1 6 y 3
Date2 5 y 1
Date2 10 z 2
Date2 20 x 3
I can produce rank values for all of my records with the following query
SELECT A.Total, A.Type, Count(*) AS Rank
FROM qryTotal AS A INNER JOIN qryTotal AS B ON A.Total<=B.Total
GROUP BY A.Total, A.Type;
The thing I am stuck on is how to rank within each date. It seems like I should insert (SELECT Count(*) FROM qryTotal….), but I am not sure to put for the WHERE. Can anyone offer some advice?
Thanks,
Ed
----Date1------ ---Date2-------
Rank Type Total Type Total
My starting point is qryTotals:
qryTotal
Date Total Type
Date1 2 x
Date1 6 y
Date1 3 z
Date2 20 x
Date2 5 y
Date1 10 z
I'm fairly sure the first step is to generate the following query which ranks Total within each Date:
qryRank
Date Total Type Rank
Date1 2 x 1
Date1 3 z 2
Date1 6 y 3
Date2 5 y 1
Date2 10 z 2
Date2 20 x 3
I can produce rank values for all of my records with the following query
SELECT A.Total, A.Type, Count(*) AS Rank
FROM qryTotal AS A INNER JOIN qryTotal AS B ON A.Total<=B.Total
GROUP BY A.Total, A.Type;
The thing I am stuck on is how to rank within each date. It seems like I should insert (SELECT Count(*) FROM qryTotal….), but I am not sure to put for the WHERE. Can anyone offer some advice?
Thanks,
Ed