Quantcast
Viewing all articles
Browse latest Browse all 10045

Pass single value or multiple value but return a list of values in SSRS 2008 r2

I have SSRS parameter @VarCode which underdoes a following transformation.

=SPLIT(join(Parameters!VarCode.Value,","),",")

which takes a user provided a list of values and attaches comma(,) to it and passes it filter the query

WHERE (VarCode like '%' + @VarCode+ '%')

so say 

xyz12345 is sample value from the db then  it lists everything which is like xyz12345.

Note: xyz is consitant in the data with different values

Now I have another value in my db(This is the only last case and no other variant available) which has another number appended in it using - like shown below


xyz12345-4567678 

Now I when I pass xyz12345 this 

It gives all associated value like shown below


xyz12345-4567678

But when I pass a list like below it errors

1.xyz12345

2.xyz67890

Expected o/p

A.I want to return a list of values when even I pass a single value

B.I want to return a list of values when even I pass multiple values


Something like this is not working

WHERE (VarCode like '%' + @VarCode+ '%') or (VarCode in @VarCode)





Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>