I have a query with 10,000 records but I only want to see the first 1,000 records...

K

Kelvin Beaton

I have a query with 10,000 records but I only want to see the first 1,000
records

How can I get an Access Querie to only return a specified number of records?

Thanks

Kelvin
 
J

Jeff Boyce

Kelvin

Define "first"!

Sort them in your query, then use the query properties to get the Top 1000.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

Franck

actually use
Select top 1000
or
Karl thing work but he forgot a parameter
Select top 20 PERCENT
but watch out if you have more than 10000 20% wont be 1000 anymore
so unless the number of records dont change use the percent else the
top 1000
 
K

Kelvin Beaton

thanks that's exactly what I was looking for...

What if I wanted to last X records?

Thanks

Kelvin
 
R

Rick Brandt

Kelvin said:
thanks, I thought of that but had to ask

I'm looking in the MS SQL online book and see there's a statement
"BottomCount" can I use that in Access?

I am unfamiliar with that, but am fairly certain that Access has no such
thing.
 
K

Kelvin Beaton

thanks, I thought of that but had to ask

I'm looking in the MS SQL online book and see there's a statement
"BottomCount" can I use that in Access?

Thanks

Kelvin
 
M

Marshall Barton

Kelvin Beaton said:
I have a query with 10,000 records but I only want to see the first 1,000
records

How can I get an Access Querie to only return a specified number of records?

Use the TOP predicate

SELECT TOP 1000 f1,f2,...
FROM table
ORDER BY somefield
 

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