如何解决在SSRS中将多个IIF与LIKE条件一起使用
我有一个使用多个IIF的表达式,但是由于某种原因,每条记录在该列中均被列为“免疫”,也许我在此查询中可能做错了什么。非常感谢您为解决此问题所提供的帮助
=IIF(Fields!CompliantWith.Value like "*Declin*","Valid Declination - " & IIF(Fields!DeclinationValue.Value <> nothing,Fields!DeclinationValue.Value,"Not Specified"),IIF(Fields!CompliantWith.Value like "*Contraindication*","Medical Contraindication - " & IIF(Fields!ContraindicationValue.Value <> nothing,Fields!ContraindicationValue.Value,IIF(Fields!CompliantWith.Value like "*Exemp*","Valid Exemption - " & IIF(Fields!ExemptionValue.Value <> nothing,Fields!ExemptionValue.Value,IIF(Fields!CompliantWith.Value like "*Immunize*","Immunized",""))))
解决方法
尝试将like
替换为.Contains
,然后删除*。
据我所知,SSRS表达式不直接支持像。
所以这个
Fields!CompliantWith.Value like "*Declin*"
会成为这个
Fields!CompliantWith.Value.Contains("Declin")
对于这样的情况,您可能还想考虑使用= SWITCH,它比嵌套的IIF更容易阅读
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。