Expression problems . . . . .

michi.for

Registered User.
Local time
, 19:28
Joined
Jan 13, 2016
Messages
45
Hi all and always ty to your important help!

I have an issue with a calculated table field:
(i know about use or use not calculated fields, but i need it)

If radiobutton is true: the field value is 1.
Else if: another value is 0, made a calculus
else put a value field.

The calculus is:
IIf([CanCost],1,iif([AntPerc]="0",(([AntVal]/[Prezzo imponibile])*100),[AntPerc]))

- [CanCost] is a radio button.
- [AntPerc], [AntVal] and [Prezzo imponibile] are integers

Return me a syntax error.....

What is wrong?
 
iif([AntPerc]="0",.......
should be
iif([AntPerc]=0,.......
 
iif([AntPerc]="0",.......
should be
iif([AntPerc]=0,.......

Ty but still the error

IIf([CanCost],1,iif([AntPerc]=0,(([AntVal]/[Prezzo imponibile])*100),[AntPerc]))

The error says:
"you may have entered an operand without an operator"
 
Shouldn't

IIf([CanCost]

Have an = True or False after it? OR is it implied in the same way as VBA interprets it ?
 
As the error says : you have an operand without an operator.
Look at the first IIF([CanCost],1,0)...

Maybe you are confused that it works like in VBA (If CanCost Then) but it doesn't. You need to tell the if what you want to compare.
 
I need this:
IIf([CanCost]="True",1,[AntRealCalc])
if [CanCost] is ticcked, the value must be 1.
if not ticched the value must be equal to [AntRealCalc]

[CanCost] is a type "true/false"
[AntRealCalc] is a "Double"
The type of this "formula-field" is "Double".

I think there is a syntax error and maybe a "type" error.....
 
You are now trying to compare "True" (A string) with True which is a logical value. Try

IIf([CanCost]=True,1,[AntRealCalc])
 
From the original post,
[AntPerc] is an integer

[AntPerc]="0" might be the problem
 
You are now trying to compare "True" (A string) with True which is a logical value. Try

IIf([CanCost]=True,1,[AntRealCalc])


That's correct.
But now i can't do the rest
With:
IIf([CanCost]=True,1,[AntRealCalc])
i got this error:
Syntax error, operand without an operator.

With:
IIf([CanCost]=True,"1",[AntRealCalc])
I got this error:
"THE EXPRESSION COULD NOT BE SAVED BECAUSE ITS RESULT TYPE, SUCH AS BINARY OR NULL, IS NOT SUPPORTED BY SERVER"

I think that the type of the field where i save the result, is wrong...and can't take NULL value.
 
Well you must be sure that "1" and [AntRealCalc] are the same type.
 
Well you must be sure that "1" and [AntRealCalc] are the same type.

Thanks for the great support,
i solved with
IIf([CanCost]=True,Fix(1),[AntRealCalc])

But don't know really why.....
Seems the problem was "1" and not [AntRealCalc]

I think putting "1", the 1 is a TEXT (but the field is a double int) and gave me error.
Putting fix(1), the 1 is a number.

Is it right?

But is weird....cause i can't return a number from an IIF....
 

Users who are viewing this thread

Back
Top Bottom