hcl-bot
February 18, 2005, 1:25pm
1
I’d like to perform simple Arithmetic on a form with the following information:
Field1 = Number Field, Editable, Default value = 2
Field2 = Number Field, Editable, Default value = 1
Field3 = Number Field, computed, with formula of Numerator / Denominator.
I keep getting Field 3: Incorrect data type for operator or @Function : Number Expected.
I have tried multiple variations of the field and formula properties with no luck. Any help will be greatly appreciated.
Thanks
pirooz
hcl-bot
February 18, 2005, 1:33pm
3
Subject: Simple Arithmetic…Not so Simple
Works fine for me in Notes 7 Beta 3, however you should put as Field3 formula at least:@If (Field1=“”|Field2=“”;“”;Field1/Field2)
hcl-bot
February 18, 2005, 1:14pm
4
Subject: RE: Simple Arithmetic…Not so Simple
Not simple, but basic.
App Dev 101: Empty fields are data type text, as opposed to a spreadsheet where they’re automatically treated as 0 when appropriate. Simplest boilerplate-type solution (Mika’s works fine as well; it just takes a modicum of thought to type out, as opposed to this one)
@iferror (Field1 / Field2)
This will handle all run-time errors, whether the fields are emtpy or not.
hcl-bot
February 18, 2005, 2:12pm
5
Subject: Simple Arithmetic…Not so Simple
Make sure you have entered the default values as 2 and 1 and not “2” and “1”.
hcl-bot
February 18, 2005, 1:54pm
6
Subject: RE: Simple Arithmetic…Not so Simple
Oops! I missed the default values posted in the original post.
Could also be the ever-popular top-down order issue; maybe Field3 is above one or both of the others in the forms layout…