I want to add a flag in my script which will compare Month/Year of my date field with the sysdate Month/Year to filter on last 5 years data.
This was my in'tial script:
case when (Extract(YEAR from e.term_date) < Extract(YEAR from sysdate) - 5)
then 1 else 0 end as FLAG
how do i change my logic to compare month and Year both? do i add another condition in case statement with Extract Month? But if i do that, i won't be able to compare that with last 5 years.