Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

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

jark1294
7 - 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")

2 REPLIES 2
JohnJPS
15 - Aurora

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

jark1294
7 - 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