Alteryx Designer Desktop Discussions

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

Convert String to Date

Orion9542
5 - Atom

Hi all,

 

I have a string I'd like to convert to a date, format as follows:

 

YYMM

 

1901-->equals 2019-01

 

I need to have 1901 converted to Month, yyyy.

 

Any ideas?

 

Thank you.

4 REPLIES 4
JoBen
11 - Bolide

Hi @Orion9542, if you use this formula, it should convert it into the format you are looking for. DateTimeFormat(DateTimeParse(tostring([Date]),"%y%m"), "%B, %Y")

JoBen
11 - Bolide

Sorry, try this formula to get it to 2019.

 

DateTimeFormat(DateTimeParse("20"+tostring([Field1]),"%y%m"), "%B, %Y")

CharlieS
17 - Castor
17 - Castor

I suggest the following:

 

DateTimeFormat(DateTimeParse("20"+tostring([Input]),"%Y%m"),"%B, %Y")

 

princejindal
9 - Comet

Find attached the solution.

Used the same method suggested by other users though.

Labels