title: DB2 Matching on different data types
body: <p>I have to tables that have a <code>join</code> field but they aren't matching data types.  One is a String and one is a Decimal. 
  When I select them using pyodbc sql query, I can use the following to get them to return identical results:</p>
  
  <p><code>int(trim(imus15))</code></p>
  
  <p><code>int(substr(cmcsno, 1, 6))</code></p>
  
  <p>However I get the following error when I run this join:</p>
  
  <pre><code>[DB2 for i5/OS]SQL0802 - Data conversion or data mapping error. (-802) 
  </code></pre>
  
  <p>I have tried:</p>
  
  <p><code>CAST(TRIM(IMUS15 AS INTEGER)) = int(substr(cmcsno, 1, 6))</code></p>
  
  <p>I cannot determine how to join on these two fields. </p>
  
  <p>IMUS15 would = <code>'112303      '</code></p>
  
  <p>CMCSNO would = <code>112303</code></p>