How to Embed a SQL Query in Microsoft Excel

Go to Data tab and select From Other Sources as shown in the screen shot below., Select “From Data Connection Wizard” in the drop down. , Data Connection Wizard will open., Connect to ODBC Data Source window appears., Select Database and Table...

13 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Go to Data tab and select From Other Sources as shown in the screen shot below.

    Select “ODBC DSN” from the available option and click “Next”. , Where a list of database available in our organization will be displayed.

    Select the appropriate database and click on “Next”. ,, So, select the database and table as appropriate in our case. , This window will pull up the File Name based on our selection in previous screens. ,,, Click on Properties in the following window. ,,,
  2. Step 2: Select “From Data Connection Wizard” in the drop down.

  3. Step 3: Data Connection Wizard will open.

  4. Step 4: Connect to ODBC Data Source window appears.

  5. Step 5: Select Database and Table window appears.

  6. Step 6: We can select the database and the table from where we wish to pull the data.

  7. Step 7: Select Finish in “Save Data Connection File and Finish” window.

  8. Step 8: Import Data window appears where we can select options as per our need and click OK.

  9. Step 9: Select “From Data Connection Wizard” in the drop down.

  10. Step 10: Go to Data tab and Click on Connections.

  11. Step 11: Go to Definitions tab in the following window.

  12. Step 12: Write SQL query in “Command Text” and Click OK. Excel will display the result as per the query.

  13. Step 13: Now go to Microsoft Excel and validate if the results are as per the SQL Query written.

Detailed Guide

Select “ODBC DSN” from the available option and click “Next”. , Where a list of database available in our organization will be displayed.

Select the appropriate database and click on “Next”. ,, So, select the database and table as appropriate in our case. , This window will pull up the File Name based on our selection in previous screens. ,,, Click on Properties in the following window. ,,,

About the Author

C

Carolyn Jordan

Creates helpful guides on crafts to inspire and educate readers.

65 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: