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

Show only top 10 rows of records???

Status
Not open for further replies.

RookieDBO

Technical User
Sep 20, 2001
83
CA
I need help on creating a query that would only show the top ten rows of records for a specific field. For instance I've got a table that contains the following field.

Customer #
Product ID
Booked Qty
Shipped Qty

Table contains 1000 rows of record. I only want to see the top 10 of "Shipped Qty" in a table. I would normally do this by sorting the "Shipped Qty", keep the first ten and delete the rest. I would like to automate this process.
Can this be done without knowing VB???

Thanks.
RookieDBO
 
Hi!

Try this:

Select Top 10 [Customer #], [Product ID], [Booked Qty], [Shipped Qty] From YourTable Order By [Shipped Qty] Desc

That should return only the top 10 records

hth
Jeff Bridgham
 
Hey Jebry,

Thanks for the solution. It did the job. In reference to the "Top 10" statement. Can that only be done in SQL view???

Thanks
 
Hi!

In QBE view, there is a box on the toolbar that normally reads All, you change make the appropriate change there.

Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top