|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
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 = '012965074400'
其中最后一句中的012965074400是存货编码。 |
评分
-
查看全部评分
|