AnsweredAssumed Answered

Calculation field evaluates even though all referenced fields are empty

Question asked by philmodjunk on Jul 24, 2014
Latest reply on Jul 25, 2014 by philmodjunk

Summary

Calculation field evaluates even though all referenced fields are empty

Product

FileMaker Pro

Version

FMPRO ADV 13.0v3

Operating system version

Windows 7

Description of the issue

A calculation set to compute the difference of two dates evaluates even when the date fields referenced in the expression are empty.

Steps to reproduce the problem

Define this expression in a field of type calculation:

If ( IsEmpty ( DateRemoved ) ; Get ( CurrentDate ) ; DateRemoved ) - DateInUse

Leave the "Do not evaluate if all referenced fields are empty" check box selected.

Create a new record (which then has both date fields empty as they do not auto-enter values) and check the value of this calculation field.

Expected result

An Empty Field

Actual result

The field shows the number of days since 12/31/0000--the numeric value of Get ( CurrentDate ) - 0.

Configuration information

Selecting stored or unstored storage options does not change the results shown.

Workaround

Modify the calculation to test for both fields empty:

Case ( IsEmpty ( DateRemoved ) and IsEmpty ( DateInUse ) ; "" ;
       IsEmpty ( DateRemoved ) ; Get ( CurrentDate ) - DateInUse;
                 DateRemoved - DateInUse
     )

Do_Not_Evaluate_bug.png

Outcomes