Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ExplorePBI
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
TeigeGao
Solution Sage
Solution Sage

Hi @ExplorePBI ,

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

Best Regards,

Teige

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.