Return nth record

25 pts.
Tags:
Database
Microsoft Access
Microsoft Access 2007
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

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • msi77
    How do you determine the order of records? Do you have autoincrement column (counter) or datetime column?
    1,670 pointsBadges:
    report
  • SbElectric
    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,540 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • Clockwatcher
    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 pointsBadges:
    report
  • msi77
    > 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,670 pointsBadges:
    report
  • Clockwatcher
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following