i write this query using t-sql and give me an error (Incorrect syntax near the keyword ‘OR’)
How to write it in correct way ?
SELECT SUM(Quantity)
FROM Invoices
WHERE Invoices.InvoiceDocStatusID =
CASE @InventoryType
WHEN 1
THEN ((2)OR(1))
ELSE 2
END
Not really that certain of the desired semantics. Do you always want rows matching
InvoiceDocStatusID=2regardless of the value of@InventoryTypeand additionally wantInvoiceDocStatusID=1where@InventoryType = 1?