wsnyder
Board Regular
- Joined
- Sep 23, 2018
- Messages
- 224
- Office Version
- 365
- Platform
- Windows
Hi all,
I am trying to pass parameters to a SQL Query
I found this article by Chirs Webb
I have parameters in Power Query from a Parameter Table on my worksheet. Both parameters show as a calendar icon in Power Query
I set up a Test Database on SQL Server and entered 3 dates and sales amount
1/31/2023, 200
2/1/2023, 100
2/28/2023, 300
I then edited Chris's code based on my database and parameters, but nothing was returned - no data, errors, or messages.
Any thoughts on what I'm doing wrong?
Thanks,
-w
I am trying to pass parameters to a SQL Query
I found this article by Chirs Webb
I have parameters in Power Query from a Parameter Table on my worksheet. Both parameters show as a calendar icon in Power Query
I set up a Test Database on SQL Server and entered 3 dates and sales amount
1/31/2023, 200
2/1/2023, 100
2/28/2023, 300
I then edited Chris's code based on my database and parameters, but nothing was returned - no data, errors, or messages.
Any thoughts on what I'm doing wrong?
Power Query:
let
Source = Sql.Database("localhost", "Yeti"),
Test = Value.NativeQuery(
Source,
"SELECT * FROM sales
WHERE salesdate >= @start
AND
salesdate <= @stop",
[start=Begin_Date , stop=End_Date])
in
Test
Thanks,
-w