Automated Query - With Maximum Record Count

M

Michael

Hi Folks - I have a 600,000 record query with the following fields and sample data:

Item Nbr Store Nbr Order Qty
3281656 1560 2
3281656 1580 2
3281656 1581 1
3281656 1606 1
3281656 1614 1
3281656 1617 2
3281656 1619 1


I need to export this query into 65,000 Excel records. So, theoretically, I would have about 9 Excel files when complete. Even though I would like a fully automated process, I am more than willing to run multiple queries and exports to accomplish the task.

Right now, I open the table, sort by Item Number, visually see where 65000 records end, then copy and paste the records into Excel. The one caveat in this process is that I cannot break in the middle of a Item Number. So, if Item number ends at 59000, and the next Item number ends at 67000, then I would only copy and paste 59000 records.

Does anyone have any ideas on how I could streamline this process?

Thanks,

Michael
 
G

Guest

One way is to use the TOP function and flag field to indicate those
previously selected.

Add a field for Exported. Create two queries - first select the TOP
100,000, the second flags those using an update query (can be a Yes/No or a
text field for an "X").

The first has criteria for Exported field NOT flagged.

The second query flags the first 65,000 as being pulled and has criteria
for Exported field NOT flagged.

Then the first query is used again with criteria not to pull those flagged
as having been pulled already.
 

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