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

Top 3 from numerous different classes

Status
Not open for further replies.

Mich2too

Technical User
Jan 27, 2001
103
US
Am working on a database for local car shows. Have a query set up to do all the needed calcs. Now need to create a report to print award certificates but ONLY want to print the Top 3 from each class. Also need to print 1st, 2nd & 3rd on the certificates accordingly, but haven't figured out how to do that either. Just learning the SQL part of Access....Thanks in advance!!
 
For "top three", you need to do a seperate query on each class. Use the score as a sort by and each query will have the three "winners" in order. Have the report set up to "Print" First ... third by the "record number"it is printing. Make the query a parameter query with the "class" being the parameter. Call the report from code. Use a loop and just 'cycle" through the classes.

MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Hi,

If you are looking a SQL on MS-Access, he provides a simple statement as follows.
SELECT Top 3 rate from Sales_history
order by rate desc;

When you want to get Top 1 to 10,

Regards.

 
Thanks for the quick responses. But I'm still missing something. Am creating one database that will be use at numerous car shows. The number of classes and the class coding will be different per show. So I can't see an easy way of creating individual queries for each class. Can understand using a parameter query for the report, but still don't get how get the 1st, 2nd & 3rd placing words to print on the report. It would be best if the user could run the report and have the top three automatically print.

KwangShin....where did you find this??? Would like to see all of the example.

Thanks again!!
 
Hi Mich2Too.

For the source of Top 3 predicate, go to MS-Access Help. But I guess it would not enough information.
If you illustrate an example, I can recognize your problem more precisely. Especially I am unable to understand the word 'class'. Of course I know that there are F-I, ... classes in car racing.
Regards.
 
Well, once "at" the show, you would know all of the "Classes". And (presumably) they (the "classes") also need to appear on the Certificate. Further, for each judgement/score, the Car AND its class need to be identified to even sort (group) them for the ranking. So all of the Classes are entered into the scoring mechanism and a simple unique query on the class field is the list of parameters to use for the other "queries".

When I said "seperate" queries, I MEANT a query with the parameter properly set up, run itteratively for the classes.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top