SUM(案例T0。[Direction] when 0 then 1 else -1 end * T0。[Quantity ])[数量]来自IBT1 T0内连接OWHS T1在T0.WhsCode = T1.WhsCode
内连接(选择T0。[ItemCode],T1。[WhsName],
SUM(CASE T0。[Direction] when 0 then 1 else -1 end * T0。[Quantity])[Quantity]
FROM IBT1 T0内部联接OWHS T1 ON T0.WhsCode = T1.WhsCode p>
按T1分组。[WhsName],T0。[ItemCode])V0 ON T0。[ItemCode] = V0。[ItemCode]和t1。[WhsName] = v0。[WhsName]在T0。[ItemCode] = [%0] GROUP BY T0。[BatchNum],T1。[WhsName],v0。[Quantity],T0。[ItemCode]
嗨,
尝试此查询,
选择T0。[ItemCode],
T1。[WhsName],
v0。[Quantity] [WhsTotal],
T0。[BatchNum],
SUM(案例T0。[Direction] when 0 then 1 else -1 end * T0。[Quantity ])[数量]来自IBT1 T0内连接OWHS T1在T0.WhsCode = T1.WhsCode
内连接(选择T0。[ItemCode],T1。[WhsName],
SUM(CASE T0。[Direction] when 0 then 1 else -1 end * T0。[Quantity])[Quantity]
FROM IBT1 T0内部联接OWHS T1 ON T0.WhsCode = T1.WhsCode p>
按T1分组。[WhsName],T0。[ItemCode])V0 ON T0。[ItemCode] = V0。[ItemCode]和t1。[WhsName] = v0。[WhsName]在T0。[ItemCode] = [%0] GROUP BY T0。[BatchNum],T1。[WhsName],v0。[Quantity],T0。[ItemCode]
问候,
Nagarajan
亲爱的 Rohan Chengappa ,
OBTQ是列出每个仓库的批次数量的表。
OBBQ包含每个仓位的批次数量。
希望这会有所帮助
Jan
一周热门 更多>