title: The data types real and numeric are incompatible in the modulo operator
body: <p>I have following sql query:-</p>
  
  <pre><code>select b.LOGTIME, b.beam_current, b.beam_energy,
    case when a.st1_vs1_bag1_onoff=0 and a.logtime=c.logtime then c.st1_vs1_bag1_rb ELSE 0 END as st1_vs1_bag1_rb ,
    CASE when a.st1_vs1_bag2_onoff='0' and a.logtime=c.logtime then c.st1_vs1_bag2_rb else '0' END as st1_vs1_bag2_rb ,
    CASE when a.st1_vs1_bag3_onoff='0' and a.logtime=c.logtime then c.st1_vs1_bag3_rb else '0' END as st1_vs1_bag3_rb ,
    CASE when a.st1_vs1_bag4_onoff='0' and a.logtime=c.logtime then c.st1_vs1_bag4_rb else '0' END as st1_vs1_bag4_rb ,
    CASE when a.st1_vs1_bag5_onoff='0' and a.logtime=c.logtime then c.st1_vs1_bag5_rb else '0' END as st1_vs1_bag5_rb ,
    CASE when a.st1_vs1_bag6_onoff='0' and a.logtime=c.logtime then c.st1_vs1_bag6_rb else '0' END as st1_vs1_bag6_rb ,
    CASE when a.st1_vs1_bag7_onoff='0' and a.logtime=c.logtime then c.st1_vs1_bag7_rb else '0' END as st1_vs1_bag7_rb ,
    CASE when a.st1_vs1_bag8_onoff='0' and a.logtime=c.logtime then c.st1_vs1_bag8_rb else '0' END as st1_vs1_bag8_rb 
  
  from INDUS2_BDS.dbo.DCCT b  INNER JOIN (main_vacuum_analog c inner join main_vacuum_status a on c.logtime=a.logtime) ON a.LOGTIME = b.LOGTIME 
  and  b.beam_current LIKE '%0' 
  and (cast(b.beam_current as int) % 10.0 &lt;= 0.01 OR b.beam_current % 10.0 &gt;= 9.99)
  and (cast(b.beam_current as int) &gt;= 9.99) -- to set the lower limit of 9.99
  and (cast(b.beam_current as int) &lt;= 220.01)
  and b.logtime between '2014-10-10 07:17:00' and '2014-10-10 08:46:00'
  </code></pre>
  
  <p>But when I execute this query I get the following error message </p>
  
  <p><strong><code>The data types real and numeric are incompatible in the modulo operator.</code></strong></p>
  
  <p>How can I resolve it? I want to show only nearby values of beam_current from 10,20,30... up to 220.</p>