Conditional Sum and Count in Crystal Reports
<p>Is there any way that I can change a formula field with this code:</p>

<pre><code>if(isnull(sum({col1}))) then
0
else
sum({col1})
</code></pre>

<p>to something like:
<em>sum(col1) WHERE col2='a'?</em>
I would like to calculate only some rows in the sum based on a value of another column.</p>

<p>In case there is, please provide me with syntax or the way to do it.</p>

<p><em>P.s: in case it matters I'm using CrystalReports 13.0 whith Visual Studio 2010</em></p>