November 20, 2009 at 2:31 pm
I have a report in which they want a parameter field to be text entry (not a drop pick list!) where a user can enter multiple values for an item no.
So for instance they need to go in and enter
55-102, 54-5677, 32-222
or
55-102
or
55-490,54-094
etc.
in my sp I am passing the param as
Where sd.item_num in (@ItemNo)
This works for just one parameter but I figure it's reading the
55-102, 54-5677, 32-222
or
55-102
as one string.
Is there a way around this?
November 23, 2009 at 7:43 am
The best way to handle this is to split the parameter passed in and put the values into a table or use a table-valued function and then join on the results. On SSC the consensus fastest way to split a string is to use a numbers or tally table. Jeff Moden has written a great article[/url] on this that you should read.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply