Search code examples
reporting-servicesssrs-2008ssrs-2012ssrs-tablix

SSRS passing parameter in between values


I got some SSRS question. I need to pass in between values in parameters. How can I do it? Sample data:

No. Records Student Name
5 Anne
5 Rick
4 John
3 Nick
2 Hazel
2 Rica
1 Mitch

The SSRS parameter should show something like this:

Select No. of Records:

1-2

3-4

5 or more

Boolean value is not working on this case


Solution

  • There are a few ways to do this, this is probably the simplest if it's not something you will repeat often.

    Manually set your report parameter labels and values as follows

    enter image description here

    Then in you data query just do something like

    SELECT * 
        FROM myTable t 
        WHERE 
               (@myParam = 1 AND NoOfRecords BETWEEN 1 AND 2)
            OR (@myParam = 2 AND NoOfRecords BETWEEN 3 AND 4)
            OR (@myParam = 3 AND NoOfRecords >= 5)
    

    Make sure myParam is the name of your SSRS report parameter, it is case sensitive.