I wants to create a SQL query to break all parent item into child item when run.
please advice..
I have something here but seems not working, could someone help to create this?
Thanks.
create view vparent as select i.id, i.itemlookupcode as ParentILC, i.quantity as ParentInstock, from item i where i.id in (select parentitem from item where parentitem = 0)
create view vchild as select i.itemlookupcode, i.description, vparent.ParentInstock * i.parentquantity as ParentQty, cast(vparent.ParentInstock * i.parentquantity as ParentQty) as CalculatedQTY from item i INNER JOIN VPARENT ON i.PARENTITEM = ParentInstock.ID where i.parentitem > 0
update item set quantity = i.quantity + vchild.CalculatedQTY where i.parentitem 0 update item set quantity = 0 where i.parentitem = 0
-------------------------------------
##-----------------------------------------------## Newsgroup Access Courtesy