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

How does DateTimeDiff function work exactly?

MichalK
8 - Asteroid

Hi,

 

I'm looking for some information on the DateTimeDiff function - I was looking at help and around here, but didn't find all the answers.

 

1. Does it matter in what order I put the dt1 and dt2 parameters?

2. If the answer to 1. is no, how can I check which date is the earlier one? I'm used to being able to use comparators (<, > and so on) on dates in different programs, I think this didn't work when I tried it in Alteryx (IIRC I got the 'incorrect data type' error).

 

Thanks,

Michal

1 REPLY 1
AdamR_AYX
Alteryx Alumni (Retired)

1. The order matters only in that it gives you a positive or negative answer depending which way round they are. If you just want to know the difference you could warp it with abs()

 

abs(DateTimeDiff([Date1],[Date2],"days"))

 

2. I think < > do work on dates

 

[Date1]<[Date2]

Adam Riley
https://www.linkedin.com/in/adriley/
Labels