Forum Discussion
Anonymous
6 years agoNot applicable
How to Reference Parameter in ODBC Query
Hi All I've got the following query and it works fine. The lines below are from the advanced editor: let Source = Odbc.Query("dsn=DW", "SELECT * FROM mwrdw.dbo.as_sales WHERE fiscyear >= 20...
- 6 years ago
Anonymous ,
Refer if this can help: https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/
Anonymous
6 years agoNot applicable
Hi
Thanks for the quick reply. Using the link you suggested I amended the advanced editor to:
let
Source = Odbc.Query("dsn=DW", "SELECT * FROM mwrdw.dbo.as_sales WHERE fiscyear >= "&Parameter1&" ")
in
Source
However I now get the following error:
Expression.Error: We cannot apply operator & to types Text and Number.
Details:
Operator=&
Left=SELECT * FROM mwrdw.dbo.as_sales WHERE fiscyear >=
Right=2020
I don't know what that means..?
amitchandak
6 years agoSuper User
You are passing as text parameter, it needs number