Groups | Blog | Home
all groups > sql server reporting services > august 2005 >

sql server reporting services : How can I combine two report parameters into a string?



Laipond
8/19/2005 10:10:06 AM
Sorry, I am new to the SQL reporting. I am not sure whether I can combine
two report parameters in a string and then use it in my querystring or not.

For example, I have a report paramter called "Month" and the other one
called "Year". Obviously I want to make them as a start date for my report
and them pass this into my querystring. Can I achieve this without writing a
stored procedure for this purpose?

Harolds
8/19/2005 10:35:04 AM
Use the command type of text.
exec sp_my_stored_procedure @Month + @Year, @Param3, @Param4
or
select * from table where date = @Month + @Year
--
Harolds


[quoted text, click to view]
Laipond
8/19/2005 12:24:03 PM
Harolds,

Thanks for the reply. I have tried the way you mentioned below. Following
is what I did and the result I got:

Case 1. In "Define Query Parameter" dialog box, I type 3/1/2005 for @month,
and leave @year blank. The reporting service can successfully pull the data.

Case 2. In "Define Query Parameter" dialog box. I type 3/1/ for @month and
2005 for @year. An error happen: "Application uses a value of the wrong type
for the current operation."

Is there any other function I can apply for this query string to make it work?

Thanks

Laipond
[quoted text, click to view]
Harolds
8/19/2005 2:37:28 PM
You are getting that error because you have @Month and/or @Year set to a
datetime data type instead of string.
--
Harolds


[quoted text, click to view]
AddThis Social Bookmark Button