Saturday, March 18, 2017

Stock balance


Stock balance 

select itemcode,itemname, sum(bal_qty) qty
from (
select itemcode,itemname, qty bal_qty  from br_receipt_detail
union all
select itemcode,itemname, -qty bal_qty  from br_issue_detail
)
group by itemcode,itemname


 Stock balance

select itemcode,itemname,sum(qty)
    from (
     select req_detail.itemcode,item.itemname,req_detail.qty from store.req_detail,store.item
    where item.itemcode=req_detail.itemcode
    and req_detail.reqno=500000137
    union all
    select itemcode,itemname,-qty from br_receipt_detail, br_receipt_master
    where br_receipt_master.recpt_no=br_receipt_detail.recpt_no
    and prs_no='500000137')
    group by itemcode,itemname

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...