Alteryx Designer Desktop Discussions

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

Datediff function not working with date in string format

ferha_jafri
8 - Asteroid

Hello Experts,

 

I am trying to evaluate no. of days between 2 dates which are in string format as "06/30/2120" and "06/30/2021". The result is coming as blank can anyone help.

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @ferha_jafri 

 

Alteryx accepts only datetime format of yyyy-mm-dd rest other formats are considered as string. Please use datetimeparse() function to parse date to proper date format.

 

Hope this helps : )

atcodedog05
22 - Nova
22 - Nova

Hi @ferha_jafri 

 

You can use formula like below.

 

DateTimeDiff(
DateTimeParse([Date1],"%m/%d/%Y"),
DateTimeParse([Date2],"%m/%d/%Y"),"days")

 

Workflow:

atcodedog05_0-1632138990165.png

 

Hope this helps : )

 

ferha_jafri
8 - Asteroid

Thank you so much.

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @ferha_jafri 

Cheers and have a nice day!

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels