473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Too slow to save a query to excel sheet

awu
All:
I have a query that has 5 fields and around 15500 records. I need to
save it to a excel file that has two sheets. First sheet saves all the
15500 records. Second sheet saves around 7500 records based on 5th
field contents. So there is comparison in the loop. I am using VBA to
execute this operation. The problem I have is the operation is too
slow. It takes more than 5 minutes.

Any other suggestion to save a query to a excel file in a faster
manner?
Thank you
awu10

Nov 8 '06 #1
2 2451

awu wrote:
All:
I have a query that has 5 fields and around 15500 records. I need to
save it to a excel file that has two sheets. First sheet saves all the
15500 records. Second sheet saves around 7500 records based on 5th
field contents. So there is comparison in the loop. I am using VBA to
execute this operation. The problem I have is the operation is too
slow. It takes more than 5 minutes.

Any other suggestion to save a query to a excel file in a faster
manner?
Thank you
awu10
Post the code you're using. If at all possible, use pure SQL to return
the dataset you want to export. Set-at-a-time operations are MUCH
faster than row-at-a-time ones. Sounds like you should create another
query for the second dataset. You can base the second query on the
first and then just use it to do the export.

Nov 8 '06 #2
On 8 Nov 2006 07:06:45 -0800, "awu" <aw***@hotmail.comwrote:

DoCmd.TransferSpreadsheet cannot be beaten.
-Tom.

>All:
I have a query that has 5 fields and around 15500 records. I need to
save it to a excel file that has two sheets. First sheet saves all the
15500 records. Second sheet saves around 7500 records based on 5th
field contents. So there is comparison in the loop. I am using VBA to
execute this operation. The problem I have is the operation is too
slow. It takes more than 5 minutes.

Any other suggestion to save a query to a excel file in a faster
manner?
Thank you
awu10
Nov 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jawahar Rajan | last post by:
All, I am using the ASP code below to save some data from a SQL Server database via ADO as an Excel spreadsheet strReportName = Request.QueryString("ReportName") If len(strReportName) > 0 then...
0
by: I Decker | last post by:
Hi all, Hope this is the right group. I am writing a program in c# to open create an excel document, enter some data, save it and then email it as an attachment. I have successfully created...
1
by: lldavid | last post by:
Hi, Can you kindly provide me sample VB codes to save a data into one single excel file with data in Sheet 1 and Sheet 2? All i was able to do is save data in Excel Sheet 1. Thanks for the...
0
by: rajeshkothuru | last post by:
Hi I am new to perl programming, i stcked at one line. I have written code such that new excel sheet will save accordingly even though if already existed Excel sheet persists. The problem is if...
0
by: Vader | last post by:
I am new to this forum. Thanks in advance for and help. The following is what I am looking for: 1. I need help with VB code to open a MS Word (.doc) file. 2. Read lines from the MS Word (.doc)...
3
by: Richard Hollenbeck | last post by:
I hope this isn't too confusing. The following query runs pretty fast by itself, but when I want to use it in a report (pasted below the query), it takes at least fifteen seconds to run! Then I...
1
by: BLavanya | last post by:
I want to Open an excel sheet , then I want to loop through the rows in the excel sheet and should execute an update query for all the rows where the where condition in the query should match the...
2
by: lindabaldwin | last post by:
Hello everyone, I am fairly new to VBA. I have a worksheet in Excel, named "Data Sheet" from which I am trying to query data. This worksheet contains the following data: unit (column A), date...
1
by: CoreyReynolds | last post by:
I can't find any information on this. If I have an existing query and I want to dump it into a page on a spread sheet and modify it as a pivot table all in VBA, can I do that? I only have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.