Getting Last Day of Previous Month in Oracle Function Getting Last Day of Previous Month in Oracle Function database database

Getting Last Day of Previous Month in Oracle Function


As an alternative to the other answers here, you can also find the last day of the previous month by getting the day before the first day of this month

SELECT trunc(your_date, 'MM')-1 as new_date from your_table

I would probably still recommend using last_day(add_months(xxx,-1)) but just showing an alternative.


select LAST_DAY(ADD_MONTHS(sysdate, -1)) from dual;

format resulting date as you like (I'll leave that one for you ;)