访问 IIF 语句以列出结果

Access IIF statement to list results

在 Access 2010 中,我试图列出我的 IIF 语句的结果,但由于某种原因无法正常工作。

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

这是我的清单:

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

我需要以下结果:

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

假设字段包含 CSV 文本并且您想要的结果遵循以下逻辑:如果字段为 Null,则 return Null,否则如果字段包含 "Failed" return "Failed",否则 "Passed",考虑:

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