IIF Statement fustration

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can you please help me with IIF statement below it accepts it but it doesnt
run with correct data what am I doing wrong??????
Thankyou what would I do without you!!!!
Kate


Return Outcome: IIf([DischSpec]=[ReAdmitSpec] & [Disch Cons]<>[ReAdmit
Cons],"Returned to same Specialty within 28
Days",IIf([DischSpec]=[ReAdmitSpec] & [Disch Cons]=[ReAdmit Cons],"Returned
to same Specialty and Cons within 28 Days",IIf([DischSpec]<>[ReAdmitSpec] &
[Disch Cons]=[ReAdmit Cons],"Returned to same Cons within 28 Days","Returned
to Different specialty and Different Consultant within 28 Days")))
 
Replace the "&" with "And".

Those two operators do different things. "&" combines two values into a
string, while "and" combines the two tests using boolean logic to return
True or False.

Return Outcome: IIf([DischSpec]=[ReAdmitSpec] AND
[Disch Cons]<>[ReAdmit Cons],
"Returned to same Specialty within 28 Days",
IIf([DischSpec]=[ReAdmitSpec] AND [Disch Cons]=[ReAdmit Cons]
,"Returned to same Specialty and Cons within 28 Days",
IIf([DischSpec]<>[ReAdmitSpec] AND [Disch Cons]=[ReAdmit Cons]
,"Returned to same Cons within 28 Days"
,"Returned to Different specialty and Different Consultant within 28
Days")))
 
John Spencer said:
Replace the "&" with "And".

Those two operators do different things. "&" combines two values into a
string, while "and" combines the two tests using boolean logic to return
True or False.

Return Outcome: IIf([DischSpec]=[ReAdmitSpec] AND
[Disch Cons]<>[ReAdmit Cons],
"Returned to same Specialty within 28 Days",
IIf([DischSpec]=[ReAdmitSpec] AND [Disch Cons]=[ReAdmit Cons]
,"Returned to same Specialty and Cons within 28 Days",
IIf([DischSpec]<>[ReAdmitSpec] AND [Disch Cons]=[ReAdmit Cons]
,"Returned to same Cons within 28 Days"
,"Returned to Different specialty and Different Consultant within 28
Days")))


kate said:
Can you please help me with IIF statement below it accepts it but it
doesnt
run with correct data what am I doing wrong??????
Thankyou what would I do without you!!!!
Kate


Return Outcome: IIf([DischSpec]=[ReAdmitSpec] & [Disch Cons]<>[ReAdmit
Cons],"Returned to same Specialty within 28
Days",IIf([DischSpec]=[ReAdmitSpec] & [Disch Cons]=[ReAdmit
Cons],"Returned
to same Specialty and Cons within 28 Days",IIf([DischSpec]<>[ReAdmitSpec]
&
[Disch Cons]=[ReAdmit Cons],"Returned to same Cons within 28
Days","Returned
to Different specialty and Different Consultant within 28 Days")))


thankyou it worked
 

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

Similar Threads

Formula Help 0
iif, or, else? 3
IIF "and" statement 2
IIF function, multiple IIF 0
iif and between 3
IF, COUNTIF & AND STATEMENTS 3
Using <= in an IIF Statement 2
Current month IIf statement. 3

Back
Top