In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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
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
Top Solution Authors