The query:
UPDATE empPac
SET quantityLimit = allocation,
allocationStart = '"&allocationStart&"',
nextUpdate = DATEADD(mm, allocationMonths, "&allocationStart&"),
lastUpdate = GETDATE(),
quantityIssued = 0,
quantityShipped = 0
WHERE allocation IS NOT NULL AND
allocationMonths <> 0 AND
(nextUpdate <= DATEADD(mm, "&checkCondition&", GETDATE()) OR
nextUpdate IS NULL) AND
empIdent in (select empIdent
from employee
where custIdent='"&custIdent&"')
What I want to do is add a conditional statement to the SET quantityLimit = allocation
so that rather than having the WHERE allocation IS NOT NULL
, I want it to have a conditional statement such as SET quantityLimit = ((allocation IS NULL) ? 0 : allocation)