How to create a simple string filter in SSRS

AttachmentSize
Image1.png10.02 KB

Categories:

If you are sure you've typed your filter condition correctly, to either include or exclude data based on a string match, try this.

In the "expression" field (where you specify where to look for a condition), use the trim() command. It works like this. If your field is "foobar", you'd enter "=trim(foobar.value)" in the expression area. This is because your field may have extra spaces that you don't see, and won't know about until your filter won't work.

I've included an example, where my condition field is "Group" and I want to exclude records that match the string "Room". Note, there are no quotes around the field in the filter window. The string datatype is assumed.

Yes, I've been building reports in SQL Server lately. :)

Add new comment

Anonymous limited

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.