This script will update the 'quantity on order' in the Item Quantities (IV00102) table
--sum all the quantities by item
--rcrdtype 2 is the 'non summary' record
select itemnmbr, sum(qtyonord) as qtyonord
into #items
from iv00102
where rcrdtype = 2
group by itemnmbr
--update the summary record
UPDATE IV00102 SET
QTYONORD = i.QTYONORD
from iv00102
join #items i on i.itemnmbr = iv00102.itemnmbr
where rcrdtype = 1
drop table #items
As always, comments are welcome.