title: how to get the exact year from the given date in oracle if it has a minimal format to base from?
body: <p>how to get the exact "year" from oracle data if the given data is in this format?</p>
  
  <pre><code>02-FEB-84
  </code></pre>
  
  <p>I want to get the year, but when I do something like this</p>
  
  <pre><code>  case
     when dob is not null then to_date(dob,'YYYY')
     when dob is null then '""'
    end
  as yearofbirth
  </code></pre>
  
  <p>I am getting the value of </p>
  
  <pre><code>2084
  </code></pre>
  
  <p>when I was expecting </p>
  
  <pre><code>1984
  </code></pre>
  
  <p>how to solve this?, because my query is not smart enough to determine if the year is from the 19th century or 20th century </p>