I need a function in Oracle
like this.
When i giving a parameter a simple date. Then function should getting me last day of the previous month.
Example:
FunctionName(10.02.2011) Result should be 31.01.2011
FunctionName(21.03.2011) Result should be 28.02.2011
FunctionName(31.07.2011) Result should be 30.06.2011 (Even date is last day of month)
How can i do that? By the way, i never use Oracle
.
SELECT LAST_DAY(ADD_MONTHS(yourdate,-1))