0
votes

I have a report that has StartDt, and EndDt as parameters. When a user leaves these blank, I default StartDt to yesterday, and EndDt to today. That works fine the the actual parameter send to SQL. But is there a way to update the SSRS Parameter Panel to show the user what dates were defaulted?

I know I could just make the parms required, but I'd rather default the dates like this so users can just put in there account(s) and move on.

1

1 Answers

1
votes

Set the default value expressions for each date parameter using the standard date/time functions.

You can set today as:

=Today()

Yesterday as:

=DateAdd(DateInterval.Day, -1, Today())

See How to: Add, Change, or Delete Default Values for a Report Parameter for more details.

Edit after comments

Say you have the following parameters:

enter image description here

StartDt and EndDt are just set up as Date/Time:

enter image description here

Set the Default Values expression for each parameter using the expressions above, i.e. =Today() and =DateAdd(DateInterval.Day, -1, Today()):

enter image description here

Now, when you load the report for the first time the two parameters are already populated with the Default Values:

enter image description here

Users can then just leave the dates as the defaults as they're already set, or change them as necessary.