@Sum Error

I’m trying to apply @sum to a database, but I’m getting the following error message : Incorrect Data Type for operator or @ function : number expected.

I have four fields that I’m trying to add up. If I have a value in every field it works fine, but if I only have values in two fields then I get the error message above.

Field names:

Adj$ - Number - Editable

Adj$-1 - Number - Editable

Adj$-2 - Number - Editable

Adj$-3 - Number - Editable

AdjTotal - Number - Computed

@Sum(Adj$;Adj$-1;Adj$-2;Adj$-3)

I need the totals of all or if I only have values in Adj$ and Adj$_1

I also now get the above error when I try and create a new form in the database.(Error refers to AdjTotal field).

Subject: Need default values

Bizarrely, if you don’t have a value in a number field, it defaults to “” (text) rather than zero (number). That’s why you get an error message when you try to @Sum fields that (as far as Notes is concerned) contain text.

So, just add default values of zero to your four number fields, and the @Sum should work.

Hope this helps,

Phil