Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Value Parameter Running a Stored Procedure

Status
Not open for further replies.

ajaeger

Technical User
Feb 6, 2003
201
US
I have a report/stored procedure working that will allow me to enter one value in the the parameter and the SP will use that to pull all record where the data is 'equal' to that value. For example, in Crystal, I'm prompted to enter a a value for @MtgCode. If I enter MTG1 for @MtgCode, the stored proc uses that in the select stmt:

Select * from Meeting where CODE=@MtgCode

That's fine, but what I really need is to be able to enter one or many meeting codes and have the select stmt work with an 'in' statement. For example, in Crystal, for @MtgCode I'd enter MTG1, MGT2, MGT3 and the select stmt would be:

Select * from Meeting where CODE in ('MTG1','MTG2','MTG3')

What is the syntax to get this to work this way? The following gives me an error:

Select * from Meeting where CODE in @MtgCode

Thanks.

Anna Jaeger
iMIS Database Support
 
Try entering all the needed characters for an IN statement:

('mtg1','mtg2','mtg3')

It would be passed as that string and then the IN operator should handle it ok..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top