MochaV
MochaV

Reputation: 19

Access IIF statement to list results

In Access 2010 I'm trying to list the results from my IIF statement but for some reason is not working.

DogTrainingStatus: IIf(([TrainingSuccess]>"*Pass*") And ([TrainingSuccess]>"*Failed*"),"Failed", IIf([TrainingSuccess]>"Failed","Failed"," "))

This is my list:

DogGroups - TrainingSuccess  
---------------------------  
A         - Pass, Pass, Pass  
B         - Pass, Pass, Failed  
C         - (Blank)  
D         - Failed, Failed, Failed  

I need the following results:

DogGroups - TrainingSuccess  
---------------------------  
A         - Pass  
B         - Failed  
C         - (Blank)  
D         - Failed  

Upvotes: 1

Views: 235

Answers (1)

June7
June7

Reputation: 21379

Assuming field holds CSV text and the result you want follows logic: if field is Null, return Null, otherwise if field contains "Failed" return "Failed", otherwise "Passed", consider:

DogTrainingStatus: IIf([TrainingSuccess] Is Null, Null, IIf([TrainingSuccess] LIKE "*Failed*", "Failed", "Passed"))

Upvotes: 1

Related Questions