In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
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

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