Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Top 5 not basing the rankings on field desired.

Status
Not open for further replies.

KaayJaay

IS-IT--Management
Jul 6, 2004
64
US
This is my code:

SELECT TOP 5 * FROM [Top 20 Installation Data]
WHERE (((MT)="s52w1"))
AND [DO] > [Forms]![Repeats Interface]![Volume]

Union
SELECT TOP 5 MT, * FROM [Top 20 Installation Data]
WHERE (((MT)="s52w2"))
AND [DO] > [Forms]![Repeats Interface]![Volume]

Union
SELECT TOP 5 MT, * FROM [Top 20 Installation Data]
WHERE (((MT)="s52w3"))
AND [DO] > [Forms]![Repeats Interface]![Volume]

UNION SELECT TOP 5 MT, * FROM [Top 20 Installation Data]
WHERE (((MT)="s52w4"))
AND [DO] > [Forms]![Repeats Interface]![Volume];

There are 3 fields that calculations may occur on in my table. One is a percentage, one is a Volume, and one is an amount. I want the top five Amounts, where the volume is greater than the minumum volume entered. Any suggestions?

If any additional info is needed just let me know.
KaayJaay
 
Usually, a SELECT TOP instruction needs an ORDER BY clause.
Just my 0.02$

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top