[Access] calculated field with condition
Hello,
I have a syntax issue with a field in a report.
It's a calculated field that calculates a change between figure A and figure B.
So in the properties, the Control Source of the field = (B-A)/A
It works, but I have a problem if A = 0; it shows #Div/0 (which is normal...). So I put
=IIf(B=0,0,((B-A)/A))
and there I get an error "The number in the expression is not valid".
I think my syntax is correct though. Does anyone have an idea?
For your information, the field has a percentage format.
Thanks in advance to whoever can help me out; I've been stuck for a while trying all sorts of syntax.
I have a syntax issue with a field in a report.
It's a calculated field that calculates a change between figure A and figure B.
So in the properties, the Control Source of the field = (B-A)/A
It works, but I have a problem if A = 0; it shows #Div/0 (which is normal...). So I put
=IIf(B=0,0,((B-A)/A))
and there I get an error "The number in the expression is not valid".
I think my syntax is correct though. Does anyone have an idea?
For your information, the field has a percentage format.
Thanks in advance to whoever can help me out; I've been stuck for a while trying all sorts of syntax.