Best way to pull multiple SQL data queries into Excel

Jon_London

New Member
Joined
Jan 24, 2019
Messages
12
Office Version
  1. 365
Hi there everyone

I have a spreadsheet that has each month of the year as a column and each of our products as a row.

I need to use SQL data queries to pull through the total amount of sales per product each month. I have the SQL script for each month/product, but I'm unsure of the best way to pull this into Excel using a Data Connection.

An example of my spreadsheet is shown below (shown as a table here). So, I would want to pull down data for e.g. Product1 for Jan, Product2 for Jan and so on. My method of creating a query for each and then "Loading" the output of the query into the relevant cell as a table, then removing the table header, seems very long winded. I'm sure there must be an easier way!

Any help would be much appreciated.

Many thanks
Jon

JanFebMarAprMayJunJulAugSepetc...
Product1
Product2
Product3
Product4

<tbody>
</tbody>
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi there.

Why not have a single query that pulls down all the raw data in one go, and then build up your table with either formulae (maybe countifs) or create a pivot table on the results. You could also consider using a more complex query that does the summing for you.
 
Upvote 0

Forum statistics

Threads
1,215,124
Messages
6,123,189
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top