restricting number of records returned in a query

  • Thread starter Thread starter David Gartrell
  • Start date Start date
D

David Gartrell

Hi there,

I wonder if someone can halp me please. I have a query that returns several
hundred rows but i'd like to restict the query to return only the first 30
rows out of the entire list. I was wondering if there's any way to do this
in SQL. I'd be very grateful for any help anyone could give.

Many thanks

David.
 
Open your query in design view.
Open the Properties box (View menu.)
Beside the Top Values property, enter 30

Whatever sorting you have in your query, add the primary key field to the
end of it so there cannot be any "tie" in the sorting. If the 30th and 31st
records tie, you get 31 records returned, even though you only asked for 30.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top