Ways to bring data from SQL server but need input parameters for SQL to read

albertan

Member
Joined
Nov 9, 2017
Messages
30
Reaction score
0
Points
6
Location
Canada
Excel Version(s)
2013
I was wondering if someone can please help me on best way to use parametirized SQL query and bring it to Power Query. I have access to SQL server with known connection string. SQL is long and needs to use specific input parameters (project numbers) in it. I don't want to have them changed each time in source so I am looking for ways to use parameters to modify the data. I may have up to 20 projects I need to change.

In "Get Data" there are few ways to do it: Microsoft Query, SQL Server database, OLEDB. But I need to specify project numbers in SQL.

What I thought might help is to use Microsoft Query and then use parameters there.
I am trying to use VBA like in this video https://www.youtube.com/watch?v=HE9CIbetNnI however I'm not sure I can use variable or parameter in VBA code where SQL can refer to range and read the SQL

Any help would be great.

https://www.mrexcel.com/forum/excel...erver-but-need-input-parameters-sql-read.html
 
Last edited by a moderator:
Welcome to the forum. :)

We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

Read this to understand why we (and other sites like us) consider this to be important.

(Note: this requirement is not optional. No help to be offered until the link is provided.)
 
Back
Top