April 30, 2011 at 4:39 pm
Hi all,
I have Option parameter in SSRS
It has let us say option1, option2, option3, option4, option5
This is a multu select dropdown in ssrs.
I have a stopred procedure
Which has option as parameter
And that stored procedure is for option1 and option2
It is something like this
If @Option=Option1 or @Option=Option2
Begin
Logic here
end
If select option1 then the results comes correctly for option1
If I select option2 then also working fine
If I select option1 and option2
Or Option2 and Option3
It is not showing up any result
---I tried doing like this also- I have used delimiter like this.
I need in the where condition some thing like thins
Where option1, option2 in ( fn_delimter(@Optiona,’,’)
But not working
Can you please help me out with this.
Thank you
pinky
April 30, 2011 at 6:32 pm
Not very clear from your post what option1, option2 etc. are - whether they are distinct columns in your DB table, or whether they are possible values in a column. I am going to assume that they are all values in a column named "option". If that is the case, you can do something like this in your where clause:
where ',' + @option + ',' like '%,'+cast([option] as varchar)+',%'
If this doesn't seem like what you are looking for, can you post your stored proc as it exists now, the table DDL, and some sample data?
May 2, 2011 at 3:35 am
With whatever I understood from your question. To me it appears that your parameter is not able to deal with multi values.
1) Try using the JOIN function
http://www.bidn.com/blogs/DevinKnight/ssis/1151/ssrs-join-function
2) and also refer this article.
In case this doesnt help, request you to provide some screenshots of your problem with a mention of what you want?
May 2, 2011 at 6:57 am
The best approach, probably outlined in the links listed above is:
-Join your multi select parameters with a JOIN statement and a comma as the separator.
-Build a table valued function that will split your parameters into a table.
-Modify your stored procedure to call the function and split your parameters apart.
May 4, 2011 at 2:35 pm
Hi,
Request you to post the solution that worked for you.....
Cheers,
Athar
May 4, 2011 at 7:12 pm
Thank you all for replying me. IT GOT SOLVED.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply