I am creating a SQL query in which I need a conditional where clause.
where
It should be something like this:
SELECT DateAppr, Time
Try this one -
WHERE DateDropped = 0 AND ( (ISNULL(@JobsOnHold, 0) = 1 AND DateAppr >= 0) OR (ISNULL(@JobsOnHold, 0) != 1 AND DateAppr != 0) )