Forum Discussion
Anonymous
9 years agoNot applicable
M - Date Format YYYY-MM-DD in Query while sending request to an API
Hi Community, I need help with yet another date formating issue where I am struggling. I am wokring on a web API call from PBI, where I have to provide start and end dates as part of my query. ...
Anonymous
9 years agoNot applicable
Anonymous Apologies for incorrect header, as I am trying to do it in M , not in DAX. Because I have to provide the query parameters in advanced editor .(Is there a way I can use DAX in there?)
fire
2 years agoNew Member
I had the same issue in PowerQuery where I need to add a date from a parameter to an SQL Statement.
- Date should be a text 'yyyy-MM-dd' wrapped in ' .. '
- value comes from a date formatted parameter
- startDate is the parameter
Solution was:
"some SQL text here ..."&Character.FromNumber(39)&Date.ToText(Date.From(startDate), "yyyy-MM-dd")&Character.FromNumber(39)&" some SQL text here ..."