Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dubaashu
Starting Member
10 Posts |
Posted - 2013-12-17 : 18:44:58
|
Dear Experts,I am having following Table Table No1 RDR1 For Order Entry where We have Order No, Item code , Order Quantity Table No2 OITW Where We have Present Stock I want help as OrderNo Itemcode OrderQty Instock Balance Qty1 I0000252 10 100 9020 I0000252 25 90 6535 I0000252 50 65 1540 I0000252 5 15 10I want my balanceqty shows in reducing basis for particular item.Thanks Ashish |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-12-18 : 07:38:13
|
[code]SELECT r.*,o.Instock ,o.Instock-r.OrderQty AS [Balance Qty]FROM RDR1 rINNER JOIN OITW oON o.Itemcode = r.Itemcode [/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|