Top 10 rows

  • Thread starter Thread starter Luke Bellamy
  • Start date Start date
L

Luke Bellamy

Hi - what is the SQL syntax Access to return the top 'x' rows
from a query?

Thanks
 
Hi Luke.

The SQL is:
SELECT TOP 15 ...

From the interface, with your query open in design view, open the Properties
box (View menu), and set the Top Values property. If you don't see that
property, make sure you are looking at the properties of the query, not
those of a column.

Also, Access can return extra rows if there are tied values. To prevent
that, add the primary key field to the end of the ORDER BY clause: it gives
Access a way to decide which record to return.
 
Back
Top