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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to limit the number of items in a bar graph 1

Status
Not open for further replies.

irethedo

Technical User
Feb 8, 2005
429
US
I have a report that displays a bar graph of bad parts which are sorted in descending order of the part number with the most failures but I also want to limit the number of failed parts displayed to the top 5 parts. The row source of my chart looks like this:

----------
SELECT ([Part Number]) AS Expr1, (Count([Part Number])) AS [Bad Parts] FROM [Bad Part qry] GROUP BY [Part Number] ORDER BY (10000- (Count([Part Number])));
----------

How can I limit the number of entries in the bar graph to display the 5 most failed parts?

Thanks in advance!
 
How about:
Code:
SELECT TOP 5 ([Part Number]) AS Expr1, (Count([Part Number])) AS [Bad Parts] 
FROM [Bad Part qry] 
GROUP BY [Part Number] 
ORDER BY (10000- (Count([Part Number])));

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks Duane- You sure made that one easy!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top