Select
last_day(add_months(date_column,-x)) + 1 from table_name;
Example:
-- First Day of the current Month.
Select
last_day(add_months(Sysdate,-1)) + 1 from dual;
-- First Day of Previous Month
Select
last_day(add_months(Sysdate,-2)) + 1 from dual;
No comments:
Post a Comment