camco
asked on
IIf statment with two variables
I am trying to get this to work but it always shows NO
=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR" OR "NIKON COOLPIX 3 YEAR WARR","YES","NO")
Thanks for the help!
Ward
=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR" OR "NIKON COOLPIX 3 YEAR WARR","YES","NO")
Thanks for the help!
Ward
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
med39,
You are very fast !!
camco,
You can use "And", "Or" and "Not" operators to logically join more than one conditions :)
You are very fast !!
camco,
You can use "And", "Or" and "Not" operators to logically join more than one conditions :)
could also be done like this:
=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR", "YES",IIF([Text17] = "NIKON COOLPIX 3 YEAR WARR","YES","NO"))
using nested IIF() function calls.
AW
=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR", "YES",IIF([Text17] = "NIKON COOLPIX 3 YEAR WARR","YES","NO"))
using nested IIF() function calls.
AW
how about using a string compare function instead.
IIF((StrComp([Text17],"NIK ON COOLPIX 2 YEAR WARR") = 0) OR (StrComp([Text17],"NIKON COOLPIX 3 YEAR WARR") = 0),"YES,"NO")
and another suggestion, use the entire Text17 name, referencing forms collection and form name, (ie. [Forms]![frmMyFORM]![Text1 7])
IIF((StrComp([Text17],"NIK
and another suggestion, use the entire Text17 name, referencing forms collection and form name, (ie. [Forms]![frmMyFORM]![Text1
ASKER
Wow that was fast! Thanks for the help.
Ward
Ward
camco, you should have selected the first comment as the answer or should have split the points
Harish,
Thanks for your fairness. I appreciate it.
-med39
Thanks for your fairness. I appreciate it.
-med39
Or did you select mine as the answer because of the next comment?
med39, please post a question in CS to select your comment as the answer or to split.
ASKER
I just screwed up. Sorry!
Ward
Ward
Harish,
Re: "please post a question in CS to select your comment as the answer or to split". I don't know what this means.
-m
Re: "please post a question in CS to select your comment as the answer or to split". I don't know what this means.
-m
https://www.experts-exchange.com/Community_Support/
https://www.experts-exchange.com/Community_Support/askQuestion.jsp
Ask a question to select your comment as answer or to split :)
https://www.experts-exchange.com/Community_Support/askQuestion.jsp
Ask a question to select your comment as answer or to split :)
Harish,
Thanks again. You have my respect.
-m
Thanks again. You have my respect.
-m
ASKER
Sorry that I caused so much trouble.
Ward
Ward
Thanks Lunchy,
Cheers med39!
Cheers med39!
=IIf([Text17]="NIKON COOLPIX 2 YEAR WARR" OR [text17] ="NIKON COOLPIX 3 YEAR WARR","YES","NO")
Bye
---
Harish