I have requirement where I need to allow the user to select at any time for 1 year worth of data and restrict the user to select start and end dates within the year selected in year parameter?
Any insight would really help!!
I have requirement where I need to allow the user to select at any time for 1 year worth of data and restrict the user to select start and end dates within the year selected in year parameter?
Any insight would really help!!
You can build a custom dataset based on your requirements (year parameter, one year limit etc) and instead of using date parameter, use text parameter and drop down list to values for date selection. Make sense?
And to build a custom dataset, you can use help from the following answer:
First create a parameter (begdate)as Data Type: Date/Time and populate the available values, Label as YYYY and Value dd/mm/yyyy - (1st of the 1st month for each year)
Example below:
In your dataset query you can reference this user selected parameter by inserting a HAVING clause:
for example:
HAVING (tbl_XYZ.AdmissionDate BETWEEN DATEADD(YEAR, DATEDIFF(YEAR, 0, @begdate), 0) AND DATEADD(yy, DATEDIFF(yy, 0, @begdate) + 1, - 1))