Hi
I am using the following code in a procedure
update bia
set bia.behovantal = convert(int, bia.behovantal) + (convert(int,
al.multipel) - (convert(int, bia.behovantal) % convert(int,
al.multipel)))
from al
where bia.artnr = al.artnr and
al.arthuvudavt = 1
I need a way to set al.multipel to 1 if it does not exist, to avoid a
divide by 0 error in the modulo function.
I am unsure how to do this since I cannot do this in a loop and assign
al.multipel to a variable and do if @multipel IS NULL then begin
@multipel = 1 end
I need another way of doing it iof possible
Any ideas would be helpful
Matt