doing a query based on record count

B

bd

is it possible to do a query in access based on record count.

For instance, I have a table with 500,000 records in it, can I place
something in my query to go against the record count.

I would like to break it down into chunks of 65,000 so that I can export my
results out to excel.

Thanks
 
K

KARL DEWEY

Try using this to split into groups where your primary key as field Prim --
SELECT a.Column1, (COUNT(*)\((DCount("Prim","YourTable-4")\[Enter number to
divide])+1))+1 AS rank
FROM [YourTable-4] AS a LEFT JOIN [YourTable-4] AS b ON a.Prim>=b.Prim
GROUP BY a.Column1;
 

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