Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Nulls in calc field-strange behavior

edited November 2001 in General
I have a FlashFiler table with two currency fields. These fields either
contain a value of $100 or they are null.

When dbcalc sum field is created to total these fields, the null values
cancel out the $100 values. Thus, if there are 20 nulls, and 20 $100
values, the sum is zero. Twenty nulls, and 30 $100 values, the sum
equals $1,000.

Any idea as to what is happening?

Thanks for any hints!

John

Comments

  • edited November 2001
    If the value is null, the DBCalc is supposed to use zero in the calculation.
    Can you send us an example to support@digital-metaphors.com

    As a workaround, use a TppVariable of currency type and code the OnCalc
    event handler for it. What values are coming through for the variable when
    the field vaue is null? If still you find no luck, then try setting the
    DataType on the variable to a floating point type and apply a currency
    display format to it.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited November 2001
    Jim,

    Thanks for the help. I will probably pursue your first suggestion. However, for
    diagnostic reasons, you may want to know the following... I wrote a routine
    which wrote zeros to the null fields en masse, and the calcs worked OK.
    Certainly, this is not the preferred solution, so thanks for the help.

    I'll zip up a small demo with the affected FF table and report.

    Thanks again,

    John

This discussion has been closed.