I need help with extracting every 12th record from a table

A

Al

I have a table that has over 300,000 records, I am iterested only in getting
every 12th record out of this table i.e. records 1, 13, 25,37,49........

Is there a way to extract these specific records out of that table and may
be place them into a new table or have a query that can perform this?
thanks
 
B

BruceM

What determines the order? A table does not have an order as such. If your
records have a field (NumField) containing a sequential number you could use
a query something like this:
SELECT *
FROM YourTable
WHERE [NumField] Mod 12 = 1;

This assumes the numberbing has no gaps, so if NumField is an autonumber
field it won't work.

This seems rather a curious thing you seek. What do you hope to accomplish?
Maybe there's a better way.
 
A

Al

Bruce, Yes I do have an sequential number field, and it worked nicely. thanks
you very much
Al

BruceM said:
What determines the order? A table does not have an order as such. If your
records have a field (NumField) containing a sequential number you could use
a query something like this:
SELECT *
FROM YourTable
WHERE [NumField] Mod 12 = 1;

This assumes the numberbing has no gaps, so if NumField is an autonumber
field it won't work.

This seems rather a curious thing you seek. What do you hope to accomplish?
Maybe there's a better way.

Al said:
I have a table that has over 300,000 records, I am iterested only in
getting
every 12th record out of this table i.e. records 1, 13, 25,37,49........

Is there a way to extract these specific records out of that table and may
be place them into a new table or have a query that can perform this?
thanks
 
B

BruceM

Glad to help. Good luck with the project.

Al said:
Bruce, Yes I do have an sequential number field, and it worked nicely.
thanks
you very much
Al

BruceM said:
What determines the order? A table does not have an order as such. If
your
records have a field (NumField) containing a sequential number you could
use
a query something like this:
SELECT *
FROM YourTable
WHERE [NumField] Mod 12 = 1;

This assumes the numberbing has no gaps, so if NumField is an autonumber
field it won't work.

This seems rather a curious thing you seek. What do you hope to
accomplish?
Maybe there's a better way.

Al said:
I have a table that has over 300,000 records, I am iterested only in
getting
every 12th record out of this table i.e. records 1, 13,
25,37,49........

Is there a way to extract these specific records out of that table and
may
be place them into a new table or have a query that can perform this?
thanks
 

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