0
votes

I have easily created a custom SQL Query to populate an Excel from an SQL database. This was quite straightforward and easy (Data/from External sources/Microsoft SQL - and then edited the command text section of the connection properties)

But now, I would like to use a WHERE clause with a parameter from a cell.

From what I read on every tutorials and similar SO questions, I should simply have to use a question mark and Excel will understand it and allow me to define a cell.

Sources:

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

That's what I did:

enter image description here

Unfortunately I got this dialog telling me that some info are missing:

enter image description here

1

1 Answers

0
votes

You should use Microsoft Query first , and then change the Command Text later.

Refer from this: Excel: Send multiple values in "Command text"