IIF Statement

G

Guest

Please advise how best to do this using simplest syntax with the end
goal/result that shows: IF [MEMBER_TYPE] = S2x or S2TX or S2T or S2 AND
[WRITING_EXAMS] = 1, THEN "Yes", ELSE "No or Not applicable". Even better,
if we can also include in the same IIF statement IF [WRITING_EXAMS] = Null,
THEN "No".

Current syntax that needs to be modified:
=IIf([MEMBER_TYPE]="S2X",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2TX",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2T",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2",[WRITING_EXAMS],"Not Applicable"))))

Many thanks,
a
 
C

ChrisHulan

Please advise how best to do this using simplest syntax with the end
goal/result that shows: IF [MEMBER_TYPE] = S2x or S2TX or S2T or S2 AND
[WRITING_EXAMS] = 1, THEN "Yes", ELSE "No or Not applicable". Even better,
if we can also include in the same IIF statement IF [WRITING_EXAMS] = Null,
THEN "No".

Current syntax that needs to be modified:
=IIf([MEMBER_TYPE]="S2X",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2TX",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2T",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2",[WRITING_EXAMS],"Not Applicable"))))

Many thanks,
a
I think this will work, but you'll need to test:
= IIF(InStr(1,"S2XS2TX",[MEMBER_TYPE])<>0 And [WRITING_EXAMS]=1,
"Yes","No or Not Applicable")


Cheers
Chris
 
S

storrboy

If [Member_Type] need only start with S2...
(LIKE may need to be '=', not sure)

=IIF([Member_Type] LIKE "S2*",IIF(Nz([Writing_Exams],0)=1,"Yes","No or
Not applicable"),"No or Not applicable")
 
G

Guest

Works like a charm. Thanks Chris!


ChrisHulan said:
Please advise how best to do this using simplest syntax with the end
goal/result that shows: IF [MEMBER_TYPE] = S2x or S2TX or S2T or S2 AND
[WRITING_EXAMS] = 1, THEN "Yes", ELSE "No or Not applicable". Even better,
if we can also include in the same IIF statement IF [WRITING_EXAMS] = Null,
THEN "No".

Current syntax that needs to be modified:
=IIf([MEMBER_TYPE]="S2X",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2TX",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2T",[WRITING_EXAMS],IIf([MEMBER_TYPE]="S2",[WRITING_EXAMS],"Not Applicable"))))

Many thanks,
a
I think this will work, but you'll need to test:
= IIF(InStr(1,"S2XS2TX",[MEMBER_TYPE])<>0 And [WRITING_EXAMS]=1,
"Yes","No or Not Applicable")


Cheers
Chris
 
G

Guest

Different ways of doing things but getting the same expected outcome. Thanks
to you all!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top