Skip to Content
0
Former Member
Nov 10, 2010 at 04:38 PM

Suppressing Footer by Sum Summary Problem - MSSQL float field?

12 Views

I'm evaluating CR2008 and came to a problem I can't find an answer to.

I'm summarizing quantity of shares in a transaction log and if the sum is zero should suppress the Footer as there is no quantity to report. This works for 95%+ of cases but there are instances where the zero is not being supressed. I'm not sure this is a problem with MSSQL's float field or if it is a problem with CrystalReports.

I have a suppression formula as follows:

If Sum({Transactions.Quanity, {Securities.Description}) = 0 Then
    True
Else
    False

This works as I stated for most instances. But some it will display a 0.0000000000 (testing with the largest rounding and decimals to see if there is a rounding problem).

The values are stored in a MSSQL database and the quantity field is of type 'float'. As a test I queried the database for one of the failing instances with query "select quantity from transactions where portfolioid=XXXX and symbolid=YYYY". This returns 52.732 and -52.732. If I where to change the suppression formula to

If Sum({Transactions.Quanity, {Securities.Description}) <= 0.0000000001 And
Sum({Transactions.Quanity, {Securities.Description}) >= -0.0000000001 Then
    True
Else
    False

the suppression works correctly. Could someone shed some light on this issue?