title: ORA-01841 while using TO_DATE with null values
body: <p>I have a date column that is formatted as number(10) data type. Some records contain -1 values (null). I would like to format that column to date type. Using the <code>TO_DATE</code> function returns this message: </p>
  
  <blockquote>
    <p>ORA-01841: (full) year must be between -4713 and +9999, and not be 0</p>
  </blockquote>
  
  <p>Is this caused by the null values? How can avoid that?</p>
  
  <pre><code>TO_DATE(TEST.PRELIM_DATE,'YYYYMMDD')`
  </code></pre>
  
  <p>Thank you </p>