SSRS - Adding "LIKE" filter criteria to report builder

TechnicalSmile picture TechnicalSmile · Apr 30, 2012 · Viewed 30k times · Source

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

Answer

Darren picture Darren · Apr 30, 2012

You could use the InStr function

=IIF(InStr(Fields!MyFieldName.Value, "2451"),TRUE,FALSE)