For example, the given date is 04/04/1924 and I want to find out the last day of February of the year 1924.
I came up with the add_month but it
Get First and Last Date of the Month Just change the Month digit to get the first and last date of the month
select
to_date('01/'|| '07/' || to_char(sysdate, 'YYYY'), 'dd/mm/yyyy') first,
last_day(to_date('01/'|| '07/' || to_char(sysdate, 'YYYY'), 'dd/mm/yyyy')) last
from dual
Result:
first last
--------------------------
01/02/2017 28/02/2017