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
Anonymous
4 years agoNot applicable
OK, in that case I would wrap the whole formula with Text.Select, like:
= Text.Select(Date.ToText(Date.From([mydate]),[Format = "YYYYMMDD"]), {0..9})
This will return just the "numbers". You may also wich to consider using Date.ToRecord and Time.ToRecord for these. These break down each date into a field for year, month and day, and hour, minute, second, respectively.
--Nate