In SQL, you must declare any variables you are using like so:
DECLARE @StartDate NVARCHAR(12)
and if I'm not mistaken, if it's declared as a variable in the report, the format is:
FormatDateTime(Parameters!Start_Date.Value, DateFormat.ShortDate)
or something like that. I pass all my parameters into stored procedures and pass the data back that way so I can change the SQL without changing the actual report.
Hope that helps!
Brett
--------------------------
Web/.net Programmer & DBA
Central PA
Did you use the correct data access provider? Using SQL Server as a source should allow you to add parameters which you will be prompted for when you execute the query and which will automatically map to your parameters if you've used the wizard. There should be no need to use the DECLARE statement. My guess is that you just don't have the parameters defined in your report itself.
I defined then using the Report tab where it says "Report Parameters" but previously I had done the parameters a different way because I did not have this issue. (Unfortunately I was cleaning up and deleted the report that had been working ok)
Does the name of the "report parameter" match the name of the "query parameter"?
You can also use "report parameters" with a query without parameters, utilizing the report parameters to filter a table or matrix or chart, but of course, that isn't usually recommended.
If you have a parameter in your query named @Startdate, and a parameter in your report parameters names Startdate, it should map it correctly. If your report parameter is named Sdate, it won't work.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.