I don't think that'll do what I want. Let me explain it a little differently. I basically want the WHERE condition to change depending on the if statement. So for example -
IF Status == 'Shipped', I want WHERE to return all the records where Field = 640 OR Field = 540 OR Field = 440
and if Status == 'BackOrder', I want WHERE to return all the records where Field = 100 OR Field = 32
and if Status is anything else, I want WHERE to return all records
Does that make better sense? Of course, this is part of a much larger query with multiple joins and all kinds of parameters, so I can't just write it like my example above. Somehow I'm hoping to put the IF THEN in the WHERE clause and have it change the condition.
Yes, Status is a parameter. Thanks very much. I will give this a try and let you know how it goes. I appreciate the help guys.