WHERE clause in SSRS expression

泄露秘密 提交于 2019-11-29 16:43:40

问题


What's the syntax for inserting a WHERE clause in an SSRS expression? I am using BIDS 2008.

=Sum(Fields!QuantityToShip.Value) WHERE FIELDS!Program.Value = "FC"

The code listed above represents the logic I want to use, but obviously inserting the WHERE in there creates a syntax error.

The purpose of this expression is to define a series' value field in a stacked bar chart.

Any help would be greatly appreciated!


回答1:


Use the IIF method:

=Sum(IIF(Fields!Program.Value = "FC", Fields!QuantityToShip.Value, 0))


来源:https://stackoverflow.com/questions/10132505/where-clause-in-ssrs-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!