SQL – EXCEL Integration

This blog covers the step by step process on linking an SQL query with a excel spreadsheet. By which we can pass parameters to the query via the excel spreadsheet and made our report an easier and flexible output.

  • First Open a Microsoft Office Spreadsheet, and choose ‘DATA’ tab.
  • On Data Tab, Select From Microsoft Query (as marked on Fig 1.1)
  • Choose Data Source Dialog Box Pop ups on selecting the above mentioned path,
  • Select an existing database or if you need to enroll a new data source, select the new data source and click ok, there you will be prompted for the database file path.
  • After selecting the database, when you click on OK button, the login screen pops out, prompting for the SQL credentials.
  • On successful login, the query columns wizard prompts for the tables on DB as selection criteria (choose any small table as we will not use based on the selected table).

Click on the next button after the columns of the tables are selected

  • Click on the next button until you reach the screen.
  • To set parameter for the query select the ‘View data or edit query’ radio button and click finish.
  • To set parameter for the query select the ‘View data or edit query’ radio button and click finish.
  • On Finish, the below mentioned screen appears, then on Criteria menu, select add criteria.
  • Select the number of criteria’s based on your parameter requirement.
  • Select the number of criteria’s based on your parameter requirement.
  • Add criteria as shown below.
  • The mandatory condition is provide [] on the value field if parameter to be obtained.
  • Enter a dummy parameter for the query.
  • The criteria will be created as shown.
  • The data will be imported as shown below.
  • Select the connections.
  • Select Properties Tab.
  • Change the command text as executing a stored procedure.
  • For Parameter prompting use a ‘?’ at the end.
  • Select the cell for the parameter.
  • Thus the output gets displayed on the screen.

The report gets refreshed on the changing the input parameter.

mm

Sathish

A silent spectator & a passionate functional consultant who is cherished always at Avaniko. His problem solving skills are amazing and impresses each customer with his quick solutions. He had joined Avaniko as a fresher and as grown into a complete business consultant handling End to End SAP B1 Implementations

Previous Post
Next Post

Leave a Reply

Your email address will not be published. Required fields are marked *

error

Enjoy this blog? Please spread the word :)

RSS
Follow by Email
LinkedIn
Share