Last post Aug 08, 2011 03:51 AM by Nishantg
Aug 03, 2011 04:42 PM|IMBack|LINK
Hi, I m new to Report Server and I managed to create a query by passing 1 parameter, but I am having difficulties passing 2 paramters,
Here is how I created a Report
at the Data tab
1 paramter) works:
SELECT ID, COMPANY
WHERE (DATE_CANCELLED < ?)
2 paramters fails:
SELECT ID, COMPANY
WHERE (DATE_CANCELLED < @DATEC) OR (ID= @id)
also tried (removing @ symbol) WHERE (DATE_CANCELLED < DATEC) OR (ID= id)
Please confirm: Assuming I can't use ? symbol when working with multiple paramters cause it will not know which one to use where.
at the Layout tab
-> report paramters -> created 2 paramters id (int) and datec (datetime)
At the Preview tab:
After entering id and date, I get an error:
An Error occurred during local report processing.
ERROR [Microsoft][ODBC SQL SERVER DRIVER][SQL SERVER] Invalid column name 'DATEC'
ERROR [Microsoft][ODBC SQL SERVER DRIVER][SQL SERVER] Invalid column name 'id'
Please let me know what am I Doing wrong... why it works when working with 1 paramter and not multiple, thanks alot
Aug 04, 2011 04:43 AM|Nishantg|LINK
The error is in your query itself, its saying that you don't have the column names in the table you specified. If your datasource is connected to a SQL server then you can use like the following.
Where Date_Cancelled < @YourParameterName Or ID = @YourParameterName
You can not use parameters without @.
I hope this will help you. Please ask me if you need any other help.
Aug 04, 2011 10:51 AM|IMBack|LINK
Hi there, The DATEC and id are the paramter names I declared at Layout tab-> Report Parameter and then at the Data tab I am tryig to use them
I think the way I am declaring is wrong, do you know a good totorial that explains how to declare/use multiple paramters,
Aug 08, 2011 03:51 AM|Nishantg|LINK
May be you are not giving the proper datatype of your parameter. Please check the below link.