Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using 'like' in ssrs expressions

Tags:

I'm trying to highlight a field when the value has the word 'deadline' in it. I'm trying to use the expression:

=IIf(Fields!Notes.Value like "%deadline%","Yellow","Transparent")

in the BackgroundColor property.

It's not highlighting the field (not changing the background color). The 'Notes' field is a text datatype and I'm using Report Builder 3.0 if that makes a difference. What am I doing wrong?

like image 404
blsub6 Avatar asked Jan 25 '12 20:01

blsub6


People also ask

How do I add expressions in SSRS report?

To add an expression to a text box 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. The Expression dialog box opens.

How do I pass multiple values to a parameter in SSRS?

In the Report Data pane, expand the Parameters node, right-click the report parameter that was automatically created for the dataset parameter, and then click Parameter Properties. In the General tab, select Allow multiple values to allow a user to select more than one value for the parameter.

How do you comment code in SSRS expression?

Try using apostrophe to write a comment. 'This is a sample comment. EDIT: VB doesn't really have multiline comment. EDIT2: Also, it seems that comment should be in the end.


1 Answers

It is like in access: not '%' but '*':

=Fields!Notes.Value Like "*deadline*" 
like image 185
devarc Avatar answered Oct 30 '22 18:10

devarc