Friday, May 30, 2008

What is the last day of last month and more

To get the first day of the month last month use this:
select TRUNC(ADD_MONTHS(SYSDATE, - 1), 'MONTH')FROM DUAL

To get the last day of the month, use this:
select LAST_DAY(ADD_MONTHS(SYSDATE, - 1))FROM DUAL

2 comments:

Anonymous said...

I have been searching my whole life for a way to do this. Sure miss working with you... J

Danny Moody said...

Miss working with you too.

Cheers,
Danny