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"
Anonymous
6 years agoNot applicable
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"Anonymous
6 years agoNot applicable
Hi Phil,
I actually could not tell if your original data the any type, a text or a datetime. Date.From usually does not care, so I suggested using it.
Hope this explanation helps,
Mike