cancel
Showing results for 
Search instead for 
Did you mean: 

how to find the first day of Previous Month

former_member202170
Active Participant
0 Kudos

hi all,

can you please advise how to find the first day of previous month

Thanks

Krishna

Accepted Solutions (1)

Accepted Solutions (1)

former_member202170
Active Participant
0 Kudos

First Day Of the Current Month : = RelativeDate(CurrentDate();-DayNumberOfMonth(CurrentDate())+1)

Last day of Previous month : = RelativeDate( [First day of current month];-1)

First day of Previous month : =RelativeDate( LastDayOfMonth( RelativeDate([last day of previous month];-45));+1)

/*****

Example : First day of current month -- 10/1/2016

last day of previous month -- 09/30/2016

relative date 09/30/2016 -45 days = 08/15/2016

last day of (08/15/2016) = 08/31/2016

relative date 08/31/2016+1 = 09/1/2016 First day of previous month

**/

Answers (4)

Answers (4)

former_member202170
Active Participant
0 Kudos

Thank you all for you suggestions.

former_member198519
Active Contributor
0 Kudos

Try using:

=RelativeDate(CurrentDate();-(DayNumberOfMonth(CurrentDate())+DayNumberOfMonth(RelativeDate(CurrentDate();-DayNumberOfMonth(CurrentDate()))))+1)

sample.jpg

amitrathi239
Active Contributor
0 Kudos

if your BO version is BI 4.1 Sp06 and above then try this.

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

former_member185603
Active Contributor
0 Kudos

Oracle DB:

select to_char(trunc(trunc(sysdate, 'MM') - 1, 'MM'),'DD-MON-YYYY') "First Day of Last Month",
from dual