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.
解決済み

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

Vaib
アステロイド

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件の返信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
アステロイド

Thank you for your help it works 🙂

MikeLR
コメット

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

 

 

ラベル
トップのソリューション投稿者