limit query to top 'n' records

L

Lez

Hi Guys,

Can anyone tell me how to limit a query to the top 'n' records? I do my
queries in the design view window not sql panel, so suggestions in view
would be most helpful.

I want to use this to see if it improves the speed of a query that I run
from a SQL BE database on an access FE

Many thanks
 
F

fredg

Hi Guys,

Can anyone tell me how to limit a query to the top 'n' records? I do my
queries in the design view window not sql panel, so suggestions in view
would be most helpful.

I want to use this to see if it improves the speed of a query that I run
from a SQL BE database on an access FE

Many thanks

Let's say the n value you want is 6.

Enter 6 in the Top Values tool button on the Query Design grid. By
default it says "All".

In SQL View it wouold read like this:
Select Top 6 TableName .... etc....
The actual records returned will be determined according to the Sort
order of the query. If there is a tie for the 6th record position it
will return more than the 6 records.
 
J

John W. Vinson

Hi Guys,

Can anyone tell me how to limit a query to the top 'n' records? I do my
queries in the design view window not sql panel, so suggestions in view
would be most helpful.

I want to use this to see if it improves the speed of a query that I run
from a SQL BE database on an access FE

Many thanks

Several ways: one is... Right mouseclick the background of the tables, and
select Properties.

Set the Top Values property to 6.

Note that if there are ties you may see more than six records.
 
L

Lez

Cheers Guys,

Perfect answer, thank you

Lez
John W. Vinson said:
Several ways: one is... Right mouseclick the background of the tables, and
select Properties.

Set the Top Values property to 6.

Note that if there are ties you may see more than six records.
 

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

Top