title: How do you convert a decimal date to a date field in a where statement?
body: <p>I have a field that is a decimal date (YYYYMMDD). I need to find all
  records that are a year or less old. Since date are so easy, I am
  trying to do:</p>
  
  <pre><code>WHERE DATE(SUBSTR(CHAR(A.CPADDT),1,4) CONCAT '-' CONCAT 
        SUBSTR(CHAR(A.CPADDT),5,2) CONCAT '-' CONCAT
        SUBSTR(CHAR(A.CPADDT),7,2)) &gt; CURRENT_DATE - 1 YEAR
  </code></pre>
  
  <p>This works great in the <code>SELECT</code> portion. When I put it in the <code>WHERE</code>
  section I get "Selection error involving field *N."</p>
  
  <p>Any ideas of what I am doing wrong?</p>