Alteryx Designer Desktop Discussions

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

Date time, Leap year

DiyaR
8 - Asteroid

Hi, 

 

Last year was a leap year. In my current work flow, my formula below is going back a year and gives me output "2020-02-28" obviously didn't considered leap year.   

 

DateTimeAdd(DateTimeTrim([Max_Date],'lastofmonth'),-1,"Years")

 

My [Max date]= 2021-02-28

 

what can I do make my output show me "2020-02-29"??

Appreciate your expertise 🙂

 

thank u 😉

2 REPLIES 2
Luke_C
17 - Castor

Try moving the datetime trim in your formula:

 

datetimetrim(datetimeadd([Max_Date],-1,'years'),'lastofmonth')

DiyaR
8 - Asteroid

Thank you, Luke. It worked. Much appreciated! 

Labels