Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Convert date from number string to date format and check if the date is valid

Vaib
8 - Asteroid

Hi

I want to convert number 20210325 (yyyymmdd) to date format and check if it's a valid date using formula tool. How can I do this.

3 REPLIES 3
Emil_Kos
17 - Castor
17 - Castor

Hi @Vaib,

 

You need to use below formula:

 

DateTimeParse(ToString([Field1]),'%y%m%d')

 

Emil_Kos_1-1616614497018.png

 

The output:

Emil_Kos_0-1616614485924.png

Regarding the validation, the column will become null if field will not have a proper date in the format specified in the formula tool.

Vaib
8 - Asteroid

Thank you for your help it works 🙂

MikeLR
8 - Asteroid

Great answer @Emil_Kos. I have this bookmarked as I still can't remember all the different specifiers! 

 

https://help.alteryx.com/current/designer/datetime-functions

 

 

Labels