diff --git a/procs/single_price_call.pg.sql b/procs/single_price_call.pg.sql index 3ec1fef..0161be2 100644 --- a/procs/single_price_call.pg.sql +++ b/procs/single_price_call.pg.sql @@ -289,7 +289,7 @@ BEGIN AND tp.ds = _last_dataseg AND tp.chan = _chan 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