Solved

Getting data from SQL using VBA in Excel - should I use views with Sum or do the summing via VBA

Posted on 2008-10-09
2
532 Views
Last Modified: 2012-05-05
I am using Excel VBA to get data from SQL tables.  I need to sum a large amount of data.  Am I better off creating Views in SQL that do the summing and then querying those views or can I just query the table and use a While loop to query the data.  I suppose a 3rd option would be to sum the data using the query right in VBA too.  So of those three options, which one is "better" and would be faster?

Thanks

Doug
0
Comment
Question by:dougshepard
2 Comments
 
LVL 5

Accepted Solution

by:
Cvijo123 earned 500 total points
ID: 22682269
there is easy answer for this .. always use sum in SQL part, eather direct in your sql select or in views.
Summing data in your exel VBA would be 100 times slowier than doing it on SQL side with aggregate functions.
0
 

Author Comment

by:dougshepard
ID: 22741130
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now