ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. 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

Last day of the previous month

sebenciven
8 - Asteroid

Hi,

 

I have these date and I would to obtain the last day of the previous month.

For example: If I have 2024-09-30 -> I would obtain 2024-08-31

 

I can't use the DateTimeFirstOfMonth(), -1, 'month' because the original date can change in every time.

 

Thanks to all!

3 REPLIES 3
binu_acs
21 - Polaris
davidskaife
14 - Magnetar

Hi @sebenciven 

 

Try this

DateTimeAdd(datetimetrim([Date],"FirstOfMonth"),-1,"day")
OTrieger
14 - Magnetar

@sebenciven 
DateTimeTrim is the function that you are looking for.
DateTimeTrim([Date],"firstofmonth") first day of the month

DateTimeTrim([Date],"lastofmonth") last day of the month

Labels
Top Solution Authors