0
votes

enter image description hereI've created a query and added date parameters withing the query. When I to run the report, I get the error message

"The report parameter 'StartDate' has a DefaultValue or a ValidDate that depends on the report parameter "StartDate". Forward dependencies are not valid.

I have written tons of reports using the same database and same parameters and this has always worked. I worked for a different company now that uses the same ERP software as my previous employer, so I'm not sure what the difference is. I'm using Visual Studio 2015, and SQL 2014

WHERE (invoicedate BETWEEN @StartDate AND @Enddate)

My parameter settings are set to use Date/Time under General, and Get values from a query under Available values. There are no default values indicated.

1
Sounds like a cascading issue. Are you sure the order of the parameters in you report is matching with the order in Stored Procedure (or SQL script)?Eray Balkanli

1 Answers

0
votes

I believe it is a cascading-related problem. Make sure the type of the variables match, as they both should be date, datetime or string. Also, please do:

1- Ensure the order of the parameters in your report completely matches with the order in your SQL Script. Example: If @param1=startDate and @param2=EndDate in the report, then make sure the Script takes startDate first as @param1 and then EndDate as @param2.

2- If EndDate is based on StartDate (like EndDate=DateAdd(month,2,StartDate), then make sure you take StartDate before then EndDate.

3- Remove default values (if any) defined in SSRS, but set it in your SQL Script.

Also, if you are using "cascading parameters", this is a good source:

https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/aa337169(v=sql.105)