Reputation: 101
I have an SSRS report that I would like to set the default end date to be 6 months prior to today's date and the start date to be 2 years prior to the end date. If I run it in September, End date would be March, next month End date should automatically update to April. How can I configure this in SSRS?
Upvotes: 0
Views: 3733
Reputation: 36
Create the parameters, and set the Default values as below:
Start Date:=DateAdd(DateInterval.Month, -30, Today()))
End Date:=DateAdd(DateInterval.Month, -6, Today()))
Use these parameter values in the data set queries to filter out the results.
Upvotes: 0
Reputation: 2490
The below expression will work as per your need, you need to put these in the parameters default value section and opt for "specify values" -
StartDate =DateAdd(DateInterval.Month,-30,Now())
EndDate =DateAdd(DateInterval.Month,-6,NOW())
Also choose the parameters as Date/Time
.
Below Snapshot to show the difference I chose Start Date as Date/Time
and End Date as Text
Upvotes: 0
Reputation: 837
Try this:
Start Date:=DateAdd(m, -30, GetDate())
End Date:=DateAdd(m, -6, GetDate())
Here are great references:
Upvotes: 0