S
S Davis
Hi folks,
I received some excellent help on friday with a Top 12 query I am
working with. It works great except that I am having trouble creating
criteria to force the results to return 12 values even if the last
results are tied.
Can anyone help me out?
Sample Data:
Bus....EDDate...NextID
2101..1/1/2003..CVIP
2101..1/2/2003..RR
2101..1/3/2003..TT
2102..1/1/2003..RR
2102..1/2/2003..RR
2102..1/3/2003..TT
So, my table is called InsFT
Labels are Bus, EDDate, and NextID
Can someone help me put this information into the example below?
This is an example tiebreaker (or query that will only return 12 values
and not 13 if the last two values are a tie) written in that post, but
I can't quite follow it in order to translate it over to my query names
and such. I didnt provide column labels, definitely would have made my
life easier!
SELECT T.Column1, T.Column2, T.Column3, (SELECT COUNT(*)
FROM [S_Davis] T1
WHERE T1.Column1 = T.Column1
AND T1.Column2 >= T.Column2) AS Rank
FROM S_Davis AS T
WHERE ((((SELECT COUNT(*)
FROM [S_Davis] T1
WHERE T1.Column1 = T.Column1
AND T1.Column2 >= T.Column2))<=12))
ORDER BY T.Column1, T.Column2 DESC;
I really appreciate it. Sorry for this desperate plea for a
handholding, but I can't get my head around it!
Thanks a lot!
-S
I received some excellent help on friday with a Top 12 query I am
working with. It works great except that I am having trouble creating
criteria to force the results to return 12 values even if the last
results are tied.
Can anyone help me out?
Sample Data:
Bus....EDDate...NextID
2101..1/1/2003..CVIP
2101..1/2/2003..RR
2101..1/3/2003..TT
2102..1/1/2003..RR
2102..1/2/2003..RR
2102..1/3/2003..TT
So, my table is called InsFT
Labels are Bus, EDDate, and NextID
Can someone help me put this information into the example below?
This is an example tiebreaker (or query that will only return 12 values
and not 13 if the last two values are a tie) written in that post, but
I can't quite follow it in order to translate it over to my query names
and such. I didnt provide column labels, definitely would have made my
life easier!
SELECT T.Column1, T.Column2, T.Column3, (SELECT COUNT(*)
FROM [S_Davis] T1
WHERE T1.Column1 = T.Column1
AND T1.Column2 >= T.Column2) AS Rank
FROM S_Davis AS T
WHERE ((((SELECT COUNT(*)
FROM [S_Davis] T1
WHERE T1.Column1 = T.Column1
AND T1.Column2 >= T.Column2))<=12))
ORDER BY T.Column1, T.Column2 DESC;
I really appreciate it. Sorry for this desperate plea for a
handholding, but I can't get my head around it!
Thanks a lot!
-S