Join the Inspire AMA with Joshua Burkhow, March 31-April 4. Ask, share, and connect with the Alteryx community!

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
binuacs
21 - Polaris
DavidSkaife
14 - Magnetar

Hi @sebenciven 

 

Try this

DateTimeAdd(datetimetrim([Date],"FirstOfMonth"),-1,"day")
OTrieger
13 - Pulsar

@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