We are trying to create a SUM of the qty shipped column for blanket orders and if not blanket we use the qty shipped in the coitem table. below is what we have we have never done this can anyone please help, we get a rowpointer error.
case when type ='B' then
(select sum(qty_shipped) from coitem_mst where coitem_mst.co_num = co_num and coitem_mst.co_line = coblnco_line group by coitem_mst.co_num)
Else
Coitemqty_shipped
end