handle nulls

This commit is contained in:
Paul Trowbridge 2025-08-18 14:36:33 -04:00
parent 379e6a5160
commit 7f5994a40d

View File

@ -289,7 +289,7 @@ BEGIN
AND tp.ds = _last_dataseg AND tp.ds = _last_dataseg
AND tp.chan = _chan AND tp.chan = _chan
AND tp.tier = _tier AND tp.tier = _tier
AND FLOOR(_last_qty / _pltq)::int <@ tp.vol; AND FLOOR(_last_qty / NULLIF(_pltq, 0))::int <@ tp.vol;
------------------------------------------------------------------ ------------------------------------------------------------------
-- Step 4: Cost data for normalization -- Step 4: Cost data for normalization