25 pts.
 Return nth record
I have a db where I can not change any data type (they are all text). I want to retrieve every 237th record.

Software/Hardware used:
Access 2007
ASKED: November 7, 2011  4:59 PM
UPDATED: November 10, 2011  4:19 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

How do you determine the order of records?
Do you have autoincrement column (counter) or datetime column?

 1,610 pts.

 

In Data Base records are not like in sequential records. Need to know the “key” or any other way that the records are organized.

 2,510 pts.

 

I might simply use a blocked FETCH with 237 rows per block. And then return just the last row of each block.

But this is “Access” and I would use an actual database, so I don’t know what is possible. Also, there’s no mention of what client is used; so I can’t guess what possible coding is involved.

Tom

 108,055 pts.

 

There is no order of records. We get them in as they were processed through the system. There is no counter but there is a datetime column.

This is my latest solution to the problem:

SELECT [Count]/14483 AS [SEQUENCE NUMBER], [table name].* INTO [new table name]
FROM [table name]
WHERE ((([Count]/14483)=Int([Count]/14483)));

 25 pts.

 

> There is no counter but there is a datetime column.

If so, you could create new table with counter and insert into it rows in the order of datetime.
Or
use the numbering rows without creating a new table. Something like this.

 1,610 pts.

 

The way I found that works: I copied my table (only the structure), then added a new field called count with data type autonumber. I then appended my old table and my copy. So now I have a new table that has the count/autonumber in it. I then ran a query on the new table with
field name: SEQUENCE NUMBER: [Count]/237
criteria: Int([Count]/237) and
field name: *
talbe name: *
and it works. I get every 237th record.

 25 pts.