I believe you can use a case statement in a where clause, here is how I do it:
Select
ProductID
OrderNo,
OrderType,
OrderLineNo
From Order_Detail
Where ProductID in (
Select Case when (@Varibale1 != '')
then (Select ProductID from Product P Where .......)
Else (Select ProductID from Product)
End as ProductID
)
This method has worked for me time and again. try it!