title: How can I filter for CURRENT_DATE / SYSDATE - 2 years?
body: <p>I have a table t with a column &quot;date&quot; which has the type &quot;DATE&quot;:</p>
  <pre><code>date
  2018-10-01
  2019-02-03
  2020-01-01
  2021-01-01
  </code></pre>
  <p>I want to get only entries where CURRENT_DATE / SYSDATE minus 2 years is true. So the result should be (CURRENT_DATE / SYSDATE = &quot;2021-05-01&quot;:</p>
  <pre><code>date
  2019-02-03
  2020-01-01
  2021-01-01
  </code></pre>
  <p>My code:</p>
  <pre><code>SELECT *
  FROM t
  WHERE YEAR(t.date) &gt;= ADD_YEARS(TRUNC(CURRENT_DATE), -2)
  </code></pre>
  <p>But that gives me the error</p>
  <blockquote>
  <p>Feature not supported: Incomparable Types: DECIMAL(4,0) and DATE!</p>
  </blockquote>
  <p>Using SYSDATE with</p>
  <pre><code>SELECT *
  FROM t
  WHERE YEAR(t.date) &gt;= ADD_YEARS(TRUNC(SYSDATE), -2)
  </code></pre>
  <p>gives the error</p>
  <blockquote>
  <p>Feature not supported: Incomparable Types: DECIMAL(4,0) and DATE!</p>
  </blockquote>
  <p>I tried <a href="https://stackoverflow.com/a/28888880/4435175">https://stackoverflow.com/a/28888880/4435175</a> with</p>
  <pre><code>SELECT *
  FROM t
  WHERE YEAR(t.date) &gt;= add_months( trunc(sysdate), -12*2 )
  </code></pre>
  <p>but that gave me the same error</p>
  <blockquote>
  <p>Feature not supported: Incomparable Types: DECIMAL(4,0) and DATE!</p>
  </blockquote>