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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Statement

Status
Not open for further replies.

Mary10k

IS-IT--Management
Nov 8, 2001
103
0
0
US
I'm trying to return one of two values if a person has a BMI>25 or if they have a weight of >210 I would like the true value to return. The following code returns BMI when neither of the above criteria is true. How can I return only the true value?

Expr3: IIf([Weight]>="210" And [BMI]>="25" Or [Weight] Is Not Null And [BMI] Is Null,[Weight] & " " & [WtUnit],[BMI])

Thank you.
 
You want this ?
Expr3: IIf([Weight]>="210" Or [BMI]>="25" Or IsNull([BMI]), [Weight] & " " & [WtUnit], [BMI])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
try:
Code:
Expr3: IIf(nz([Weight]) >=210,"True", Iif(nz([BMI]) >25, "True", "False"))

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
True value not 'True' - never mind [blush] duh

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top