Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WHERE clause in SSRS expression

Tags:

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!

like image 434
sion_corn Avatar asked Apr 12 '12 22:04

sion_corn


People also ask

How do you set expressions in SSRS report?

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.

How do I use IIF in SSRS 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.

How do you write if else condition in SSRS report expression?

=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.

What is CDate in SSRS?

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.


1 Answers

Use the IIF method:

=Sum(IIF(Fields!Program.Value = "FC", Fields!QuantityToShip.Value, 0))
like image 167
Sir Crispalot Avatar answered Sep 19 '22 15:09

Sir Crispalot