title: Calculate date of birth SQL DB2 and indicate bad data
body: <p>I am trying to calculate the age at the time of students admission. I have tried this query, but in some cases I have admission date is prior to their date of birth (bad data). </p>
  
  <p>For example: </p>
  
  <pre><code>date of birth is 2016-10-22-00.00.00.000000 
  admission date is 2016-09-09-14.51.00.000000 
  </code></pre>
  
  <p>I am getting 0, but I should get something with the (-) negative number, so I can see this is bad data. Thank you</p>
  
  <pre><code>SELECT * 
  FROM   (SELECT student_id, 
                 Timestampdiff(256, Char(Timestamp(admission_date) - 
                                         Timestamp(date_of_birth))) 
                 AS Admission_DOB 
          FROM   person) AS a 
  WHERE  admission_dob &lt;= '10' 
  </code></pre>