title: How to calculate the difference between two dates with a return value type of integer in Informix?
body: <p>I am using an Informix database. I want to get the difference between two dates, and the data type of return value must be an integer. The SQL looks like:</p>
  
  <pre><code>select (today - to_date('20121201','%Y%m%d'))  from your_table_name
  </code></pre>
  
  <p>However, when I execute the SQL it returns 45 and certainly the computed value is not the integer type.
  What's the date type of the value? How can I cast the value to integer?</p>