Welcome to the forum.
Put your calc inside an "IF" statement:
If [ EnrollDate <> "" AND DischargeDate <> "" ; DischargeDate - EnrollDate ; "" ]
Note: I used <> to denote "not equal to"
That way you check that there's something there before you do the math...if not, it returns null ("").
Is that what you're after?
Many thanks for your quick reply, but I must be doing something wrong as that doesn't seem to work.. I am getting (The Specified Field can not be found) so I changed it to thefollowing:
If [ Date Enrolled: <> "" AND Date of Discharge: <> "" ; Date Enrolled: - Date of Discharge: ; "" ]
but still not working..
What Filemaker says at the bottom of the 'Don't not evalute if all referenced fields are empty' what I want is for Filemaker to ONLY evalute is BOTH fields are not empty.
Thanks anyway for your help... Malcolm
"...but still not working.."
Exactly how is it not working? If Date Enrolled: and Date of Discharge: are your two date fields, then this should work.
What result type have you selected for your calculation? (It should be the default "number" type.)
I think it's probably just the syntax. Let me retype without substitutions and see if that doesn't get you there.
Assuming the field name of your Date Enrolled is Date Enrolled (no colon) and Date Discharged is Date Discharged (no colon) your calculation field would be defined as:
If [ Date Enrolled ≠ "" AND Date Discharged≠ "" ; Date Enrolled - Date Discharged ; "" ]
For the field names in the calculation, select them from the upper left pane. It's easier to keep the syntax correct that way.
Side Questions: Is the colon in your field name? Where did the single colon come from? I am assuming that all three fields are on the same table...
Case ( Date of Discharge ; Date of Discharge - Date of Enrolment )
Many thanks indeed...