title: ora-01841 full year must be between 4713 and 9999 and not be 0
body: <p>I have been working on a query that is making me go crazy because I couldn't seem to understand the error message: my query is:</p>
  
  <pre><code>SELECT  MYTABLE." ID ", 
  
  
    NVL(max(TO_DATE(TO_CHAR(ADD_MONTHS(MYTABLE." XISSU_DT " ,MYTABLE." XTNR "), 'DD/MM/YYYY'),'DD/MM/YYYY')),  TO_DATE(SYSDATE , 'DD/MM/YYYY') )  MAXLASTINSDATE,
  
     TO_DATE(SYSDATE , 'DD/MM/YYYY'), 
  
  
        (TO_CHAR (TO_DATE(SYSDATE , 'DD/MM/YYYY')
             - TO_DATE(NVL(max(TO_DATE(TO_CHAR(ADD_MONTHS(MYTABLE." XISSU_DT " ,MYTABLE." XTNR "), 'DD/MM/YYYY'),'DD/MM/YYYY')),  TO_DATE(SYSDATE , 'DD/MM/YYYY') ) , 'DD/MM/YYYY')) * -1) MaturityPeriod
  
  
       FROM MYTABLE
  where  
  MYTABLE." STATUS " = 'A'
  group by MYTABLE." ID "
  </code></pre>
  
  <p>the Error I have been getting is:</p>
  
  <pre><code>ora-01841 full year must be between 4713 and 9999 and not be 0
  </code></pre>
  
  <p>Your help is really appreciated! </p>