title: Cast varchar to an integer in Teradata
body: <p>here is what i have:</p>
  
  <p>SELECT * FROM Trans
  WHERE TRANSID IN (</p>
  
  <p>select CAST(TRIM(FIRSTNAME) AS INT)  from Customer
  where trim(firstname) between '0' and '9999999999999999'
  AND custid not in
  (select custid from address) )</p>
  
  <p>Have numerical values in this firstname column that i have to trace back to the trans table, in which the values in the firstname column are transid's.</p>
  
  <p>getting an error:  SELECT Failed. 2620: The format or data contains a bad character</p>