Hi, I have a field with 1/1/2022 00:00 that Alteryx automatically change to a Date data type. I want to change it back to a string to show "1/1/2022 00:00". I used the DateTime tool to change it a string format using the formula %m/%d/%Y %H:%M but that results in 01/01/2022 00:00. I need the month and day to only show one digit for the months that only have 1 digit. Can someone help me with a formula for a one digit month and day? Thanks.
Solved! Go to Solution.
Hi,@ELPC
There are 2 easy formulas for you:
1- If you want use classic Replace function, use the below formula:
TrimLeft(Replace(ToString([Date]),"/0","/"),"0")
2- If you like use RegEx function, then use the formula:
REGEX_Replace(ToString([Date]), "0(?=\d\/)", "")
*******
If this formula as your want, please mark it as a solution for more share.