0
votes

In Excel 2013 I am embedding a SQL Server query into my workbook so that it may be refreshable. If I click the Data Tab then From Other Sources then choose SQL Server and input my query (just for example sake)

Select Top 1 employeename 
from employees
Where hiredate between A1 AND A2

And in A1 the value 04/10/2016 is entered and in A2 the value 04/15/2016 is entered. How would I read the value from the cells into my where clause?

1

1 Answers

0
votes

In order to read data from the workbook for use as a parameter in a query you need to import your data using Microsoft query.

Please refer to the forum post here for more information.

How to add parameters to an external data query in Excel which can't be displayed graphically?