Home Where Clause Case Statement

# Where Clause Case Statement

user5529
1#
user5529 Published in September 19, 2018, 11:28 am

How can I have a where clause be based on a variable:

If I have a variable @PrintNum and it has a number I want a different where clause, but it not it is different. See below: Is this possible?

Where PrintNum = @PrintNum
Else
Where InvNum = @InvNum,


etc....

• It's not very clear what your'e asking. Please edit your question to include sample data as DDL + DML. and desired results. – Zohar Peled Apr 15 at 10:02