Forum Discussion
UncleLewis
4 years agoResponsive Resident
Get Date As Text
Hi all, How can I get Date from DateTime field as Text in format "YYYYMMDD"? I tried Date.ToText([mydate],[Format = "YYYYMMDD"]) Buget getting error: Parameter Error: We couldn't convert th...
- Anonymous4 years ago
Try this:
Date.ToText(Date.From([mydate]),[Format = "YYYYMMDD"])
--Nate
UncleLewis
4 years agoResponsive Resident
The same pattern does not appear to work for time - why is that?
Here is what I tried:
=Time.ToText(Time.From([mytime]),[Format = "HHMMSS"])
Error: Parameter.Error: We couldn't convert the the text value to time using the specified format. The format includes a date component.
Thanks,
-w
- Anonymous4 years agoNot applicable
For Time.FromText, it's , [Format = "hh:mm:ss"])
Power Query thinks "MM" is months.
--Nate