Get all dates greater than current date in SSRS

2.4k Views Asked by At

I have two parameters in my Report - Begin and End Dates which are of Date/Time type. When I select the Begin Date from the Calendar, how do I automatically show dates equal to or greater than Begin Date for the End Date calendar? I would like the have the user the ability to select only End dates after Begin date.

1

There are 1 best solutions below

0
papermoon88 On

This could be a potential workaround going off the comment I made to your question. You would need three datetime parameters:

-#1 StartDate

-#2 EndDate

-#3 EndDate2 - make this hidden

The StartDate and EndDate (#1 and #2) are for users to select. For the report, we will use StartDate (#1) and EndDate2 (#3) to filter.

You can set the default for StartDate/EndDate however you would like. For EndDate2, if the user selects a date prior to the start date, default the end date that gets passed to the report. We set this by adjusting the default value for EndDate2 parameter with the IIF function to compare the user input dates.

Add this to default value for EndDate2 parameter:

=IIF(Parameters!EndDate.Value < Parameters!StartDate.Value, Parameters!StartDate.Value, Parameters!EndDate.Value )