Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS - Adding "LIKE" filter criteria to report builder

I want to add a LIKE filters with wildcards in SSRS report builder. I tried this using contains clause present in filter data section of report builder. I tried both '*' and '%', but of them failed.

I tried MyFieldName contains 2451 - this succeds MyFieldName contains 24* - this fails MyFieldName contains 24% - this fails

From below link I feel that this is an old problem with no solution till yet.

http://connect.microsoft.com/SQLServer/feedback/details/202792/ssrs-adding-like-filter-criteria-to-report-builder

What do you guys suggest?

Thanks
Ravi Gupta

like image 807
TechnicalSmile Avatar asked Dec 09 '22 00:12

TechnicalSmile


2 Answers

You could use the InStr function

=IIF(InStr(Fields!MyFieldName.Value, "2451"),TRUE,FALSE)
like image 142
Darren Avatar answered Dec 25 '22 17:12

Darren


In SSRS we can't use Like. Instead of which you can use Contains.

IIF((MyFieldName).ToString().Contains("RequiredString"),"True","False)
like image 23
N.Sreenivasa Rao Avatar answered Dec 25 '22 19:12

N.Sreenivasa Rao