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
Microsoft Access

Avatar of undefined
Last Comment
Gustav Brock
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ajaeclarke
ajaeclarke

ASKER

You are a legend Gustav! Thank you so much. :)
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

You are welcome!
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo