title: SQL CAST String to Decimal
body: <blockquote>
    <p>SQL0802 Data conversion or data mapping error</p>
  </blockquote>
  
  <p>The fields not being <code>CAST</code> are decimals. The fields I am trying to <code>CAST</code> are strings.</p>
  
  <p>I have tried different variations or <code>CAST</code> and <code>CONVERT</code> on this <code>case</code> expression.  I'm fairly certain this syntax is correct. I am still getting the error though. </p>
  
  <pre><code>CASE WHEN cpssn=amssn THEN amfnam||amlnam
       WHEN cpssn=CAST(maassn as DECIMAL(9)) THEN maafnm||maalnm
       WHEN cpssn=CAST(mpssno as DECIMAL(9)) THEN mppfnm||mpplnm 
  END as Name
  </code></pre>