title: Query returning a zero when dividing in the select statement
body: <p>When i try to divide the first nested select statement by the count of a column, the query returns a zero. When I replace the "/" with a ",", I receive two different numbers so the return value shouldn't be a zero. Could this have something to do with there being zeros in the data set? Any help would be appreciated</p>
  
  <pre><code>declare @hospitalfk int;
  set @hospitalfk='1335'
  
  declare @startdate date;
  set @startdate='03/01/2014'
  
  declare @enddate date;
  set @enddate='02/28/2015'
  
  declare @reportname varchar(50);
  set @reportname='%Medicaid Billable Report%'
  
  declare @metasectionname varchar(100);
  set @metasectionname='Medicaid Primary'
  
  select 
  (
  select count(iscoded)
  from ope.ope.vwerali 
      where iscoded=1 
          and hospitalfk=@hospitalfk
          and reportdate between @startdate and @enddate
          and reportname like @reportname
          and metasectionname like @metasectionname
  )
  /count(iscoded)
  from ope.ope.vwerali
      where hospitalfk=@hospitalfk
          and reportdate between @startdate and @enddate
          and reportname like @reportname
          and metasectionname like @metasectionname
  </code></pre>