Alteryx Designer Desktop Discussions

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

Converting Multiple Date format to one format

dunkindonut7777
8 - Asteroid

I how to convert these dates in one column using formula tool.

DateExpected Output
2023-02-25 00:00:002023-02-25
6/21/20232023-06-21

 

Can you help me with this one pls.

2 REPLIES 2
binuacs
21 - Polaris

@dunkindonut7777 One way of doing this

image.png

IIF(Contains([Date], "-"), DateTimeParse([Date],"%Y-%m-%d"), IIF(Contains([Date], "/"), DateTimePArse([Date],"%m/%d/%Y"), Null()))
ShankerV
17 - Castor

Hi @dunkindonut7777 

 

Please use the below formula.

 

IF REGEX_Match(Left([Date],4),"\d{4}")
THEN DateTimeParse([Date],"%y-%m-%d")
ELSE DateTimeParse([Date],"%m/%d/%y")
ENDIF

 

Many thanks

Shanker V

Labels
Top Solution Authors