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!
In Design view, click the text box on the design surface to which you want to add an expression. For a simple expression, type the display text for the expression in the text box. For example, for the dataset field Sales, type [Sales] . For a complex expression, right-click the text box, and select Expression.
Using IIF Function in SSRS We are going to add a new field to the report data set to determine if the Order Year is the Max or Current Year. As shown below, the dataset properties window is opened, and the Fields tab is selected. After clicking Add, at the bottom of the list a new field is added.
=iif(First(Fields! Debit. Value, “ARForm”)=True,” Debit”,” estimate”) We don't have to construct else conditions in IFF in SSRS; all simply must do is state whatever we want to happen if the condition is met and what want to occur if the condition is not satisfied.
The CDate function converts the value to a date. The Now function returns a date value containing the current date and time according to your system. DateDiff returns a Long value specifying the number of time intervals between two Date values.
Use the IIF method:
=Sum(IIF(Fields!Program.Value = "FC", Fields!QuantityToShip.Value, 0))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With