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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using an in clause with more than 1 value

Status
Not open for further replies.

sodakotahusker

Programmer
Mar 15, 2001
601
I just got news that the dynamic sql I wrote for a search function is not acceptable. I have modified it all to use static code but I'm stuck on one last field. I have two status values which should be returned when one status value is passed. So for example 4 = Paid
7 = Confirmed. If 4 is passed in they want 4's and 7's. Can I build that without using dynamic sql?

I tried and (field in ( @variable ) ...
and that works if only one is assigned but it expects an integer value so assigning 4,7 blows it up.
Am I going to have to bite the bullet and create multiple selects for each situation or is there a way to word this to provide the filter I need with static sql?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top