title: Check if field is numeric, then execute comparison on only those field in one statement?
body: <p>This may be simple, but I am no SQL whiz so I am getting lost. I understand that sql takes your query and executes it in a certain order, which I believe is why this query does not work:</p>
  
  <pre><code>select * from purchaseorders
  where IsNumeric(purchase_order_number) = 1
  and cast(purchase_order_number as int) &gt;= 7
  </code></pre>
  
  <p>MOST of the purchar_order_number fields are numeric, but we introduce alphanumeric ones recently. The data I am trying to get is to see if '7' is greater than the highest numeric purchase_order_number. </p>
  
  <p>The Numeric() function filters out the alphanumeric fields fine, but doing the subsequent cast comparison throws this error:</p>
  
  <pre><code>Conversion failed when converting the nvarchar value '124-4356AB' to data type int.
  </code></pre>
  
  <p>I am not asking what the error means, that is obvious. I am asking if there is a way to accomplish what I want in a single query, preferably in the where clause due to ORM constraints.</p>