Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help writing complex conditional expression

Status
Not open for further replies.

leeroi

Technical User
Jun 5, 2000
122
US
well, at least for me it's complex :)

I'm using this expression: =Sum(IIf([Refused]=-1,1,0)) to calculate the number of records that have a -1 value for the field "Refused". I want to expand this so that the sum reflects the number of occurrences of this field, but ONLY if a second field "Qualified" has a null value. I think that part would look something like IsNotNull([Qualified]).

I don't know how to put these together to make the expression work. Can you help?

Lee
 
Refused appears to be a YesNo field, so how about:

[tt]Sum(IIf(IsNull(Qualified),Abs(Refused),0))[/tt]
 
Thanks. With a little tweaking, the expression worked just fine.

Can you suggest a reference (preferably net-based) that I can use to learn more about how to write these kinds of expressions in VBA?

Lee
 
Tek-Tips! Forum705 has a great many examples of expressions. It is always worth doing an advanced search.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top