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

Convert yyyymmdd to mm/dd/yyyyy

rrafferty2
8 - Asteroid

Hi All:

 

I tried a number of ways to convert a v String into a standard date format, but to no avail.  I used the parse tool with date feature, and still not able to get it to work.

 

I am sure its simple, but I can't get my head around which tool and configuration set up.

 

rrafferty2_0-1589831910767.png

 

 

Thanks

Robb

 

 

6 REPLIES 6
estherb47
15 - Aurora
15 - Aurora

Hi @rrafferty2 

The challenge here is what Alteryx considers a standard date format, which is yyyy-mm-dd

You can use 2 data time parse tools. One to turn the string into an alteryx date, and another to write back out into the desired string format.

 

Alternately, you can use the Formula tool with datetimeparse and datetimeformat functions.

 

Let me know if that helps.

Cheers!

Esther

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @rrafferty2,

 

You could use the following DateTimeParse function:

 

DateTimeParse(ToString([Date]),'%Y%m%d')

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

 

estherb47
15 - Aurora
15 - Aurora

If you want to go the formula route:

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

It's a bit convoluted, but it works. Set the data type to string.

rrafferty2
8 - Asteroid

Thank you. It works.

 

Robb

rrafferty2
8 - Asteroid

Thanks, Looks like I am allowed to pick only one solution.  both are great.

 

Robb

aashishbhardwaj
5 - Atom

Hi,

I tried this but I am getting error: Argument1 of DATETIMEPARSE is not a string

 

aashishbhardwaj_1-1606174548818.png

 

Labels