community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

How do I use DateTimeLastOfMonth() for the previous current month?

I tried putting a function [  DateTimeAdd(DateTimeToday(),-1,'month')  ] inside the DateTimeLastOfMonth() function but it states that there are too many arguments ... 

What I'm really looking for is an easy way to output the last day of the month from the month previous to this month.  (As of time of writing ... 12/31/2018).

I bet this is super simple but I'm not able to obtain it easily.

Thanks!

Bolide

@price_is_right

 

easiest way is datetimeadd(datetimefirstofmonth(),-1,'days').

 

Reset back to the first day of this month and go back one day. This is best because the last of month function will vary based on the number of days in a month (30 vs 31).

 

Lastly, the datetimelastofmonth() is not really a function, per se, as it cannot contain parameters. It's only used to determine the last day of the current month. Same goes for datetimefirstofmonth().

Thanks Neil!  I was unaware that the "LastofMonth()" wasn't really a function.  

Labels