Learn how to a build a cloud-first strategyRegister Now


SSRS Switch to evaluate

Posted on 2011-10-17
Medium Priority
Last Modified: 2012-08-14
I'm trying to use Switch to color code cells on a report.  I'm trying to evaluate a string and color code a "days outstanding" cell if the number of days exceeds a threshold.  Currently I get the following error:

[rsRuntimeErrorInExpression] The BackgroundColor expression for the text box ‘Textbox49’ contains an error: Argument 'VarExpr' is not a valid value.

I'm using the Switch expression since I'll have about 10 different values to compare.

=Switch(Fields!String1.Value = "Bank of America" and DateDiff("d", today(), Fields!Date1.Value)*-1 >14, "Red", "Transparent")

Open in new window

Question by:mlehnen
LVL 37

Accepted Solution

ValentinoV earned 500 total points
ID: 36985232
The Switch statement needs an even number of arguments.  See also: http://www.experts-exchange.com/A_2279.html

See snippet for a possible correction to your statement.
=Switch(Fields!String1.Value = "Bank of America" and DateDiff("d", today(), Fields!Date1.Value)*-1 >14, "Red", True, "Transparent")

Open in new window


Author Comment

ID: 36985672
That worked perfectly by adding the additional argument.  Thank you!

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question