Export Qry to Excel

bconner

Registered User.
Local time
Today, 14:19
Joined
Dec 22, 2008
Messages
183
If I have a Qry with more than 65,000 rows how can I export it into excel and have any rows after 65,000 drop into another worksheet in the same workbook?


Any help is greatly appreciated.....
 
Could your query not be split into smaller queries?
 
Unfortunately not.......
 
Unfortunately not.......

You should be able to do that. You need to loop through the Recordset and write 65000 Records or less on each pass (remembering to increment the WorkSheet Tab ID) until the RecordSet is fully written to as many Excel Tabs as it takes.
 
You should be able to do that. You need to loop through the Recordset and write 65000 Records or less on each pass (remembering to increment the WorkSheet Tab ID) until the RecordSet is fully written to as many Excel Tabs as it takes.

Could you give me an example of looping through the recordset? I'm also trying to extract data from my query to excel.
 
You could try using something like:
Select top 65000 .... from ...

then do an outer join with above query for sheet2
And another outer join with both above for sheet3
etc...

That is assuming you have some kind of PK in the query(s)
 

Users who are viewing this thread

Back
Top Bottom