Float value using case in SQL Server
<p>I have this code and I'm trying to compare <code>[Dis]</code> to <code>[Estimator]</code> which is a variable I am adding: </p>

<pre><code>SELECT 
    [Id],
    [Sym],
    [Month],
    [Dis],
    Estimator =  4/count(Id) over (partition by Sym, Month)
FROM 
    [RegularPayResultsYearly]
</code></pre>

<p>Again, I'm trying to compare <code>Dis</code> to <code>Estimator</code>.</p>

<p>For example, the <code>count(Id) over (partition by Sym, [Month])</code> is 12091 observations. </p>

<p>The problem : while the <code>Dis</code> column is a <code>float</code> type (example values : 
8.2944916060179E-06, 9.07691249104339E-05) it seems that the </p>

<pre><code>4/count(Id) over (partition by Sym, [Month])  as cnt 
</code></pre>

<p>which is 3.308245802663138e-4 cannot go further than zero and it showing me 
Estimator = 0. </p>

<p>Any way to change that? </p>

<p>Thanks. </p>