Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Friends
I need to calculate number of days of previous month.
For example: If selected month is May , then it should return number of days in April, ie 30.
Below correctly gives number of days for current month. But I need previous month.
num(Monthend(max(DATE_OF_ISSUE)) -Monthstart(min([DATE_OF_ISSUE])))
Kindly help. Thanks in advance.
Regards
Chintan
Just try below
=Day(Monthend(Addmonths(Today(),-1)))
refer this document.
Dear Kamal
Thanks for your reply .It is not working fine for few of the months like Sep, Oct, Nov, Dec and Jan.
For other months it works fine.
Regards
Chintan
oops my mistake, here is the updated one.
Dear Kamal
It is still same. I believe it is because July and August both have 31 days!
Regards
Chintan
I think I didn't save it before uploading, can you go to script and just update the correct number of days against each month. I am in meeting sorry. The problem is I put incorrect number of days for the months.
You have taken correct in script. But it does not calculate correctly in the text object
Just try below
=Day(Monthend(Addmonths(Today(),-1)))
Can be further shortened into this
=Day(MonthEnd(Today(), -1))
Thanks for your reply Vineeth and Sunny.
=Day(Monthend(Addmonths(Today(),-1))) and
=Day(MonthEnd(Today(), -1))