limit query to top 'n' records

  • Thread starter Thread starter Lez
  • Start date Start date
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
 
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.
 
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.
 
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.
 
Back
Top