cancel
Showing results for 
Search instead for 
Did you mean: 

1st day of previous month

Former Member
0 Kudos

Hello,

My name is Neuza Sous, and I'm working with Business Object since last months so I need your help so solve a little problem.

I had use the following formula to give me the 'Last day of previous month', but now the formula stop worked because when it calculates the month it takes one the the current month, but in case of January this doesn't work because is the month 1.

I need to current the formula or update it, and I thought to do it we a 'If' but I'm not sure about how to do it.

Can you please help me?

Thank you in advance.

Neuza Sousa

Accepted Solutions (0)

Answers (3)

Answers (3)

balajee_sivakumar
Contributor
0 Kudos

Hi Neuza,

    Try the below formula in WebI to get last day of previous month for any month in the year

=FormatDate(RelativeDate(ToDate("01/" + FormatDate(CurrentDate();"MM/yyyy");"dd/MM/yyyy");-1);"dd/MM/yyyy"),

Regards,

Balajee SK

0 Kudos

A bit long winded,but gives the answer you need.  There probably is a better way of doing it.

=ToDate("01/"+(ToNumber(FormatDate(RelativeDate((ToDate("01/"+(ToNumber(FormatDate(CurrentDate();"MM")))+"/"+ToNumber(FormatDate(CurrentDate();"yy"));"dd/MM/yyyy"));-1);"MM")))+"/"+ToNumber(FormatDate(RelativeDate((ToDate("01/"+(ToNumber(FormatDate(CurrentDate();"MM")))+"/"+ToNumber(FormatDate(CurrentDate();"yy"));"dd/MM/yyyy"));-1);"yy"));"dd/MM/yyyy")

Former Member
0 Kudos

Hi,

Can you add a condition (textual explanation), if(month=jan, 1st day of lastyear december,this formula). ?