Philb24
Philb24

Reputation: 67

Excel - Passing a parameter into a custom query

Hi i am trying to create a table in excel with a parameter from a cell.

as you can see from the image below i am trying to change the value 7006 into a variable parameter.

If anyone could help me it would be appreciated.

I have blocked out the Server and Database Name.

enter image description here

I now get this error: enter image description here

Upvotes: 1

Views: 169

Answers (1)

Sergey Lossev
Sergey Lossev

Reputation: 1530

Open extended editor and replace 7006 by this

"& ContactIDP &"

So your code should look like this

... WHERE (ContactID = "& ContactIDP &"))) OR ...

This will concatenate your ID to SQL-query. Make shure that your parameter's type is text. Otherwise apply Text.From() function

... WHERE (ContactID = "& Text.From(ContactIDP) &"))) OR ...

Upvotes: 1

Related Questions