I have the following statement
SELECT b.Prig
FROM Tirr tr
JOIN Bud b
ON tr.ID = b.ID
WHERE b.Syst = 1 and tr.Salesmen = @SalesID
In the above statement, I need to do b.Syst = 1 only if b.Call is not ’55’ so I need a case statement but not sure how to incorporate it
I have tried:
SELECT b.Prig
FROM Tirr tr
JOIN Bud b
ON tr.ID = b.ID
WHERE
case b.Call
when '55' then
b.Syst = 1 and tr.Salesmen = @SalesID
else
tr.Salesmen = @SalesID
1 Answer