cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ExplorePBI Frequent Visitor
Frequent Visitor

query level date parameter

Hi,

 

Issue with passing a date parameter to the SQL query in Power BI. 

I have created a parameter with date data type, trying to pass that date param to the query but received a conversion error.

 

SQL query:

 

Select * from table1 where created_date <= '" &StartDate& "'

 

Created_date in the table is in date format.

StartDate parameter also is in date format.

 

Error message: 

Message=Conversion failed when converting date and/or time from character string.
Number=241
Class=16

 

Thanks

1 REPLY 1
Highlighted
TeigeGao Super Contributor
Super Contributor

Re: query level date parameter

Hi @ExplorePBI ,

Please change your parameter to text type, the date type cannot be combined with text type.

Best Regards,

Teige