用友U8.72 SQL现存量查询语句

SELECT dbo.Warehouse.cWhName AS 仓库名称,dbo.CurrentStock.cInvCode AS 存货编码, 
dbo.Inventory.cInvName AS 存货名称, dbo.Inventory.cInvStd AS 规格型号, 
dbo.Inventory.cInvAddCode AS 存货代码, dbo.CurrentStock.cBatch AS 批号, 
dbo.CurrentStock.cFree1 AS 存货备注, SUM(ISNULL(dbo.CurrentStock.iQuantity, 0)) 
AS 现存量, SUM(ISNULL(dbo.CurrentStock.fAvaQuantity, 0)) AS 可用数量, 
SUM(ISNULL(dbo.CurrentStock.fOutQuantity, 0)) AS 待发货数量, 
SUM(ISNULL(dbo.CurrentStock.fInQuantity, 0)) AS 待入库数量, 
SUM(ISNULL(dbo.CurrentStock.fTransInQuantity, 0)) AS 调拨在途数量, 
SUM(ISNULL(dbo.CurrentStock.fTransOutQuantity, 0)) AS 调拨待发数量
FROM dbo.CurrentStock INNER JOIN
dbo.Inventory ON dbo.CurrentStock.cInvCode = dbo.Inventory.cInvCode INNER JOIN
dbo.Warehouse ON 
dbo.Warehouse.cWhCode = dbo.CurrentStock.cWhCode INNER JOIN
dbo.ComputationUnit Unit ON 
dbo.Inventory.cComUnitCode = Unit.cComunitCode
GROUP BY dbo.Warehouse.cWhName, dbo.CurrentStock.cInvCode, 
dbo.Inventory.cInvName, dbo.Inventory.cInvStd, dbo.Inventory.cInvAddCode, 
dbo.CurrentStock.cBatch, dbo.CurrentStock.cFree1
having CurrentStock.cInvCode = '物料编码'
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值