Forum Discussion
PhilC
6 years agoResolver I
Convert Date to specific text format without creating new column
Hi, I would find the syntax to convert an existing Date column into text, in the "dd/MM/yyyy" format, but do within the column, not by adding a new column. Using Date.ToText([Start Date], "dd/MM...
- Anonymous6 years ago
PQ is very sensitive to Date versus DateTime. Sometimes i have to convert to a DateTime. Below is some sample code.
Regards,
Mike
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Extracted Date" = Table.TransformColumns(Source,{{"myDate", each Date.ToText(Date.From(_),"dd/MM/yyyy") , type text}}) in #"Extracted Date"
TommiBerlin
2 years agoNew Member
My goal is to get the data for today (so whenever we update the datasource. As the combination of date & text in the web.Contens() is not possible, we had to convert to it to text in an "yyyy-MM-dd".
Solved it like that.
= Json.Document(Web.Contents("https://api.xxxx/client?json=1&from=" & Date.ToText(Date.From(DateTime.LocalNow()),"yyyy-MM-dd") & "&to=" & Date.ToText(Date.From(DateTime.LocalNow()),"yyyy-MM-dd") &"T23:59:59Z"))