title: SQL - Operand data type varchar is invalid for sum operator
body: <p>I'm running the following query and getting the Operand data type varchar is invalid for sum operator error.  The accountnature field is a varchar field, but I'm casting it as INT and I'm still getting the error.</p>
  
  <pre><code>SELECT
      'Qualified' =sum(case when (cast(AccountNature AS Int)) in ('a','b') then '1' end)
  
  from agreement
  
  group by accountnature
  </code></pre>
  
  <p>Any thoughts on what I'm doing wrong or how to fix?
  Thanks.</p>