创建视图[dbo]。[Item_WHS_PRICE]作为选择T0。[ItemCode],T0。[WhsCode],sum(T0。[StockValue])/sum(T0。[OnHand])as StockPrice from OITW T0 WHERE T0 。[OnHand]> 0 GROUP BY T0。[ItemCode],T0。[WhsCode] GO
按以下方式使用查询视图
选择T1。[ItemCode],T1。[OnHandQty],t3.StockPrice AS'UNIT_COST',T1。[OnHandQty] * t3.StockPrice AS STOCKVALUE,'AUD'作为货币,T2。[BinCode]作为LOCATION_ID从 [dbo]。[OIBQ] T1的内部联接OBIN T2在T1上。BinAbs= T2.AbsEntry T1的内部联接dbo.item_whs_price T3.ItemCode = t3.itemcode和t1.whscode = t3.whscode WHERE T1。[OnHandQty]> 按T1.ItemCode排序
嗨,
请在此处分享您的查询以进行检查。
谢谢
嗨,
这是我的查询
选择T7。[BinCode]作为"当前箱"
,T0。[ItemCode] AS"项目代码"
,T1.ItemName AS"项目描述"
,SUM(T0。[OnHand] -T0。[IsCommited])AS" Put-Away Qty"
FROM OITW T0
T0.ItemCode = T1.ItemCode上的INNER JOIN OITM T1
在T0.ItemCode = T3.ItemCode和T0.WhsCode = T3.WhsCode上向左外OIBQ T3
在T7.AbsEntry = T3.BinAbs上左加入OBIN T7
按T7。[BinCode],T0。[ItemCode],T0。[ItemCode],T1.ItemName分组
HAVING SUM(T0。[OnHand] -T0。[IsCommited])!= 0
这是一个两步过程。
第1步,创建如下所示的视图
创建视图[dbo]。[Item_WHS_PRICE]作为选择T0。[ItemCode],T0。[WhsCode],sum(T0。[StockValue])/sum(T0。[OnHand])as StockPrice from OITW T0 WHERE T0 。[OnHand]> 0 GROUP BY T0。[ItemCode],T0。[WhsCode] GO
按以下方式使用查询视图
选择T1。[ItemCode],T1。[OnHandQty],t3.StockPrice AS'UNIT_COST',T1。[OnHandQty] * t3.StockPrice AS STOCKVALUE,'AUD'作为货币,T2。[BinCode]作为LOCATION_ID从 [dbo]。[OIBQ] T1的内部联接OBIN T2在T1上。BinAbs= T2.AbsEntry T1的内部联接dbo.item_whs_price T3.ItemCode = t3.itemcode和t1.whscode = t3.whscode WHERE T1。[OnHandQty]> 按T1.ItemCode排序
一周热门 更多>