Hi
I want to Select from Oracle DB all rows where YEAR portion of invoice = Current Year - 4 years.
I always want the selection to start from January 1 four years ago.
Therefore if the current date is 15-April 2022. I want the selection to start at 1-Jan-2018
I used the following but this starts at 15-Apr- 2018
and to_date(INVOICE_DATE) between to_date(SYSDATE) -4*365.25 and to_date(SYSDATE)
Thanks
Gerald
SELECT ...
WHERE invoice_date >= to_date('01-Jan-' || to_char (to_number(sysdate, 'YY')-4))