Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a variable $'(vMonthENDDATE)'= date(monthend(today(),0),'YYYYMMDD') which returns the value of 20161130(Current Month End date)
What should be the expression if I want to create a variable to return the value of 20161031?(Previous Month end date)
Hi Badhikari,
The expression will be:
date(monthend(today(), -1),'YYYYMMDD')
Which is pretty similar to yours, the difference is the -1 instead of zero.
use $1 instead of $...
Thanks,
Praveen Kumar S
maybe
the previous month end of current month end date
is 1 day before current month start
=date(monthstart(today()) -1, 'YYYYMMDD')
=Date(MonthStart(Today())-1,'YYYYMMDD')
You can try something like this.
vPriorMonthENDDATE = Addmonths(vMonthENDDATE,-1)
This will not work
For Example: 28th of February will return 28th of January which is not a month end. You would have to include MonthEnd formula again like:
vPriorMonthENDDATE = MonthEnd(Addmonths(vMonthENDDATE,-1))
I however would follow maxgro suggestion:
=date(monthstart(today()) -1, 'YYYYMMDD')
hth