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

  • Thread starter Thread starter Al
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top