Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting records in a table (DCount)

Status
Not open for further replies.

timbar

Technical User
May 15, 2003
15
0
0
US
I'd like to extract records from a table using a query. I think that I need to use a query criterion built with the expression builder.

In particular, I have a table that contains 1577 records. What I want to do is use a Make-Table Query with a criterion that pulls out the first 256 records of the 1577 table, then the next 256, then the next 256, until the all records are extracted. The process is simply subdividing my 1577 table into (in this case) siz 256 record tables and a seventh table with the left over 47 records.

I've done a little checking for a Access function that will do the job. What I've come up with is the DCount function.

I'm not sure this is the best function to use, or even if it will work to do what I want.

What I need is someone to tell me what a criterion expression should be to accomplish waht I wish to do. My 1577 record table had a primary key (ID). I don't want to use this field, but a record count, as the basis of the criterion.

Thanks in advance for your input.

Tim Barbour
 
If your ID numbers are continuous then you can consider dividing the ID by 256 and finding the integer of the result. This should divide your records into groups with a calculated value of 0, 1, 2, ...
This is a really very unusual request since there is rarely a need to create tables with subsets of records.

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top