3
votes

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?

1

1 Answers

8
votes

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.