Link to home
Create AccountLog in
Avatar of ajaeclarke
ajaeclarke

asked on

Expression has the wrong amount of arguments

Hi

I am having some trouble with the below expression in a query. I am trying to get the average of three fields which allows for zero's.

ACWLW: ([RELTTMALW]+[AOLTTMALW]+[WTMALW])/IIf((-([RELTTMALW]<>0)-([AOLTTMALW]<>0)-([WTMALW]<>0))

It is telling me that The Expression you entered has a function containing the wrong number of arguments.

It has been a long day and I just cannot see it!! Could somebody please enlighten me :-)

Thanking you
Avatar of Daniel Pineault
Daniel Pineault

IIF() expects 3 input variables, the criteria to test for, what to do if it is TRUE, what to do if it is FALSE.
If you explain what should be happening, we can try to further help.

Also, ypically I would use Nz([FiledName], 0)  to always ensure there is a numeric value being returned just in case a field is empty, Null which could cause errors to be thrown.
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of ajaeclarke

ASKER

You are a legend Gustav! Thank you so much. :)
You are welcome!