Conditional WHERE clause in SQL Server
问题 I am creating a SQL query in which I need a conditional where clause. It should be something like this: SELECT DateAppr, TimeAppr, TAT, LaserLTR, Permit, LtrPrinter, JobName, JobNumber, JobDesc, ActQty, (ActQty-LtrPrinted) AS L, (ActQty-QtyInserted) AS M, ((ActQty-LtrPrinted)-(ActQty-QtyInserted)) AS N FROM [test].[dbo].[MM] WHERE DateDropped = 0 --This is where i need the conditional clause AND CASE WHEN @JobsOnHold = 1 THEN DateAppr >= 0 ELSE DateAppr != 0 END The above query is not working