Incorrect Data Type foe Operator or @Function : Number Expected

Hi All,

I have a Form in a database to calculate Quotations…

A Person can input weight and I have formula to calculate quote accordingly.

Sub total derived in a Number type computed field and it work fine up to this point. Field Name is STOT ( Field type Number )


Now I want to people to input a discount in another field and then final total is derived taking into consideration of the value in this discount field.

This is what I have done:

Created a Number type field ( Editable) Field Name is DIS

Default value is 0

Then Created another Number Type field(FTOT) (computed) and have below formula in it’s default value:

STOT - ( STOT * DIS/100)

When I save and open the Form I get following error:

" Incorrect data type for Operator or @Function: Number Expected"

Any Advice??? on How do I incorporate discount value to calculated in this application??

Thanks in Advance…

Mira

Subject: Incorrect Data Type foe Operator or @Function : Number Expected

Mira, A question.

If you remove DIS and/or FTOT, does the error go away?

As well, if you have a ‘Default Value’, then the FTOT field is editable and not computed.

Shawn

Subject: RE: Incorrect Data Type foe Operator or @Function : Number Expected

Yes If I remove DIS and FTOT fields, then this error go away…Sorry FTOT is computed field and it’s ‘Value’ is set as given formula:

STOT - ( STOT * DIS/100)

Subject: RE: Incorrect Data Type foe Operator or @Function : Number Expected

Mira,

What field does it list in the error dialogue? When I create these three fields on a test form I get that error for FTOT, is that consistent with yours?

Thanks,

Shawn

Subject: RE: Incorrect Data Type foe Operator or @Function : Number Expected

Shawn,

Thanks…

me too, I get the error message for FTOT …

Field ‘FTOT’ : Incorrect Data Type foe Operator or @Function : Number Expected

Subject: RE: Incorrect Data Type foe Operator or @Function : Number Expected

Mira,

Try this:

Field FTOT := STOT - ( STOT * DIS/100)

Shawn

Subject: No Luck even for this time ??

Hi Shawn,

Thanks for your post, but it’s still does not work this time formula didn’t go through:

I entered folowing to FTOT field value:

Field FTOT := STOT - ( STOT * DIS/100)

Then there’s an error msg as:

No main or selection expression in formula ‘)’

I can’t belive why such a small thing didn’t work , could there be a bug or something in these computed fields ? or are we missing out some important concept on this…??

Anyway thanks for your post, appreciate your efforts, will keep searching until we find something…

Cheers

Subject: Oh Well !! Found the answer from this Forum itself…

https://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/575304d0e2375ee68525708a004d5f70?OpenDocument

Subject: RE: No Luck even for this time ??

Yeah. That message is always expected when you use such formula. When you use this as a formula → Field FTOT := STOT - ( STOT * DIS/100)

This should be followed by FTOT ie;

Field FTOT := STOT - ( STOT * DIS/100);

FTOT

But this is as good as STOT - ( STOT * DIS/100) which is your previous formula for the field FTOT.

If there is still any problem, you should either do:

STOT - ((STOT * DIS)/100) or STOT - (STOT * (DIS/100))

OR

ds := @ToNumber(@Text(DIS))

st := @ToNumber(@Text(STOT))

st - ((st * ds)/100) or st - (st * (ds/100)) as per your requirement.