**Inventory Table**:
StoreNo Date ProductBarCode ProductQty
61 2016-02-28 2017961746012 100
61 2016-02-29 2017961746012 100
61 2016-03-01 2017961746012 100
61 2016-03-02 2017961746012 100
61 2016-03-03 2017960624045 100
61 2016-03-04 2017961746012 100
75 2016-03-04 2017960624045 90
61 2016-03-05 2017961746012 100
StoreNo Date ProductBarCode SaleQty
61 2016-02-29 2017961746012 8
75 2016-03-04 2017960624045 0
61 2016-03-01 2017961746012 2
61 2016-03-04 2017961746012 -5
所需的輸出:
StoreNo Date ProductBarCode ProductQty
61 2016-02-28 2017961746012 100
61 2016-02-29 2017961746012 92
61 2016-03-01 2017961746012 90
61 2016-03-02 2017961746012 90
61 2016-03-03 2017960624045 100
61 2016-03-04 2017961746012 95
75 2016-03-04 2017960624045 90
61 2016-03-05 2017961746012 93
我想通過計算(INVENTORY + ALL ADDITIONAL PRODUCTS COMING IN) - ALL SOLD PRODUCTS
確定實際數帶時間戳。庫存每月採取一次,所以我加入了日曆表並顯示t他的日期和價值。 如果我是subtract from i.qty - s.qty
它將在當天銷售單獨扣除如果我再次檢查第二天庫存將顯示100 .. 有人可以建議?!!
消息209,級別16,狀態1,行233 不明確的列名'productqty'。不明確的列名'productqty'。我得到這個錯誤 – Krish
@Krish:修改 – TheGameiswar