Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Date conversion to not include 0 in 12/01/2017

Highlighted
Meteor

I'm trying to change a date to format MM/DD/YYYY, but need to keep it as a vw string so i can use it in a lookup later. The input data has a date as 12/01/2017, for example, and i want it to just be 12/1/2017. Or vice versa for the other data set. I'm used this formula but it isn't getting rid of the 0

 

DateTimeFormat([Date],"%m/%d/%Y")

Highlighted
ACE Emeritus
ACE Emeritus

Would something like this work:

TrimLeft(Replace(DateTimeFormat([Date],"%m/%d/%Y"),"/0","/"),"0")

This trims the leading zero if there is one, and also the middle zero if there is one.

Hope that helps!

John

Highlighted
Meteor

Thank you! I actually thought of the same thing while i was waiting for a response, but figured alteryx community would come with something. This is perfect, appreciate it!

Labels