My query is , I need to give input a month ,i.e ex :input will be 'MAR' then i need to get 1st date and last date for the March month .
select to_char(trunc(trunc(sysdate, 'MM'), 'MM'),'DD-MON-YYYY') "First Day of Last Month"
, to_char(trunc(sysdate, 'MM') ,'DD-MON-YYYY') "Last Day of Last Month"
from dual ;
Any one please help..
month_start := to_date('MAR', 'MON');
month_end := last_day(month_start);
If the year is also a variable input:
month_start := to_date('2015-MAR', 'yyyy-MON');