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?
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?