Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Services Reporting Services Cascading Parameter

I have 2 parameters in my report to select a date range:

StartDate & EndDate

I want to hide the StartDate and allow users to just select the EndDate which should then dynamically change the start date to 1 year before the EndDate.

I need this to happen every time a user changes the EndDate changes.

I'm pretty sure I have to use cascading parameters, but I don't know how.

Any suggestions?

like image 358
lacky Avatar asked Jul 29 '26 02:07

lacky


1 Answers

Yes, cascading parameters are the trick if you want to do this at the report level. (You could also handle this pretty effectively at the query level.)

  1. First arrange the parameters in your report in order of dependence: EndDate should be be listed above StartDate. Use the up and down arrows to rearrange the parameters.
  2. Set the StartDate parameter to be "Internal" and set the default value appropriately. Select "Specify values" and create a value of =DATEADD( DateInterval.Year, -1, Parameters!EndDate.Value )

Now you can use both @EndDate and @StartDate in your query without initializing them and they will be passed the SSRS value.

like image 100
Jamie F Avatar answered Jul 31 '26 18:07

Jamie F



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!