IIf Error Expression in Query (1 Viewer)

DoneganF

Registered User.
Local time
Yesterday, 19:34
Joined
Aug 7, 2012
Messages
29
Hello All - I have an expression in a query in which I need to layer in an "If Error" clause. I tried the following, but received the error message;

"The expression you entered has a function containing the wrong number of arguments"

Here's the expression I entered:

NETCOLL:=IIf(IsError([PAYMENTS]/([CHARGES]-[CONTRACTUALS]),0,[PAYMENTS]/([CHARGES]-[CONTRACTUALS]))

Any insight is greatly appreciated!
 

DoneganF

Registered User.
Local time
Yesterday, 19:34
Joined
Aug 7, 2012
Messages
29
I was actually looking for some suggestions on how to resolve the expression. But thank you for the advice on tagging future posts - I will definitely utilize tags going forward.

Again .... any help on resolving the expression is greatly appreciated!;)
 

Gasman

Enthusiastic Amateur
Local time
Today, 02:34
Joined
Sep 21, 2011
Messages
14,048
In English, what are you trying to identify that would produce a zero value?
 

DoneganF

Registered User.
Local time
Yesterday, 19:34
Joined
Aug 7, 2012
Messages
29
When I run the base expression, without trying to trap errors, certain records (where Charges = 0) will return the following error; #Num!

Here is the base expression
[PAYMENTS]/([CHARGES]-[CONTRACTUALS])

What I want the error expression to do is replace the #Num! with a 0.
 

plog

Banishment Pending
Local time
Yesterday, 21:34
Joined
May 11, 2011
Messages
11,613
certain records (where Charges = 0) will return the following error; #Num!

Mostly incorrect. Records where Charges=Contractuals will return #Num!

Use that in conjunction with Gasman's advice
 

Users who are viewing this thread

Top Bottom