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
 
Back
Top