title: Calculations being being rounded SQL Server 2012
body: <p>I am trying to calculate some performance metrics as <code>[RATE]</code> in SQL but no matter what I do I am only getting integer values in return.</p>
  
  <p>In my dataset I have a Numerator and a Denominator both stored as integers that are broken down into groups and subsets. The rate is calculated slightly differently depending on the group and subset. For group 1 the calculation is simply N/D. For group 2 the calculation is (N*1000)/D with the exception of 1 subset which is calculated (N*10000)/D.</p>
  
  <p>I wrote the query as:</p>
  
  <pre><code>SELECT [Group]
        ,[SubSet]
        ,[Numerator] N
        ,[Denominator] D
        ,CASE WHEN D=0 Then NULL
          WHEN [Group]='G1' THEN [N]/[D]
          WHEN [SubSet]='S2' THEN ([N]*10000)/[D]
          WHEN [SubSet] NOT LIKE 'S2%' AND [G] NOT LIKE 'G1%' THEN ([N]*1000)/[D] as [RATE]
  </code></pre>
  
  <p>No matter what I do the outcome variables are integers. I tried formatting <code>RATE</code> as <code>varchar</code>, <code>decimal</code>, and <code>float</code> with no success. I tried changing N and D's format to <code>varchar</code>, <code>decimal</code>, and <code>float</code> as well. I tried changing the equations from <code>(N*1000)/D</code> to <code>(N/D)*1000</code> but still no effect.</p>
  
  <p>What am I missing/doing wrong? </p>