Selecting records by rowID

K

Kirk P.

I've got a table of 11,000 records. Don't ask why, it's a long story, but I
need 11 queries like this:

Query 1: records 1 - 1000
Query 2: records 1001 - 2000
Query 3: records 2001 - 2000

and so on. Any way to do this?
 
J

Jerry Whittle

Access doesn't have a RowID. Do you have a field, perferrably a primary key
field, that is numbered consecutively? If not you could add an Autonumber
field and it MIGHT number the fields. However you can't depend on this as
Autonumber fields are just guarenteed to be unique IF it's the primary key
field. Consecutive numbers are not guarenteed.

If youhave something like this, you could put criteria in individual queries
such as:

<1001
Between 1001 And 2000
Between 2001 and 3000

If you don't have such a field, you might get some of the records out by
sorting ascending on the primary key field and using the Top 1000. You could
then sort descending and do a Top 1000 and get the last 1000 records. However
Top will also include duplicates in the last spot show you could have more
than 1000 records if not on a primary key field.
 

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