title: SOQL Type conversion (SalesForce.com)
body: <p>The problem is that I need to compare two fields of different types in a SOQL query.</p>
  
  <p>TextField is a Picklist (so really text) and IntField is a Number(2, 0).  Changing the types of these fields is not possible.</p>
  
  <p>I would like to write SOQL like;</p>
  
  <pre><code>SELECT Id FROM SomeObject__c
  WHERE Cast(TextField as Integer) &gt; IntField
  </code></pre>
  
  <p>Obviously <code>Cast(TextField as Integer)</code> does NOT work.</p>
  
  <p>Any advise on type conversion within SOQL.  The normal APEX functions (e.g. integer.valueof) don't seem to be of any help here.</p>
  
  <p>Thanks</p>