Alteryx Designer Desktop Discussions

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

Datediff from string - excel format

Baz123
8 - Asteroid

Hi,

 

I have two date fields that I need to find the days between :

StartEnd
30-Jun-202218-Aug-2022
10-Aug-202218-Aug-2022

 

You can see the format above that is in the raw data, which Alteryx reads as a string.

 

I used :

 

DateTimeDiff(
DateTimeParse([Start],"%d/%m/%Y"),
DateTimeParse([End],"%d/%m/%Y"),"days")

 

But this throws the error, as the data is in the wrong format as expected :

 

ConvError: Formula (5): DATETIMEPARSE: Cannot convert "18-Aug-2022" to a date/time with format "%d/%m/%Y" and language "English": Expected a number for Month: 'Aug-2022'

 

Any help on tweaking the formula so it can calculate days would be great.

 

Thanks.

2 REPLIES 2
gautiergodard
13 - Pulsar

Hello,

Please see attached solution! 

 

**Please like this post and mark this thread as resolved if this provided the answer to your question**

Baz123
8 - Asteroid

@gautiergodard Thanks!

 

Using the DateTime tool is where I was going wrong in a previous attempt.

 

When I had it setup I used the "Select format that matches the incoming string field". It had to be as you had it set with a custom format.

 

Appreciate the help :)

Labels