ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

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
Top Solution Authors