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

Display the first 10 records

Status
Not open for further replies.

shahatul

Programmer
May 28, 2002
23
US
I have a query which has more 100 records. I want to display only first 10 records. For example:
Select Customer.Company_Name, Max(Orders.Order_Date) AS dMostRecent From Customer ;
Left Join Orders ;
On Customer.Customer_ID = Orders.Customer_ID ;
Group By 1 ;
Into Cursor MostRecentOrder

Any idea?
Thanks in Advance.
 
Try this:

Select TOP 10 dist Customer.Company_Name, ;
Max(Orders.Order_Date) AS dMostRecent ;
GROUP BY 1 ;
ORDER BY 2 descending ;
FROM Customer,Orders ;
WHERE Customer.Customer_ID = Orders.Customer_ID ;
INTO CURSOR MostRecentOrder

Brian
 
Thank you very much Brian

Warm regards
Shah AV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top