on 04-09-2014 3:20 AM
Hi all
Any way to get this report to show remaining Batch Items on hand to show
batch, qty, price....
Item cat no. ABC
Date rec Batch Qty Price total
01.01.14 12345 5 1.00 5.00
03.01.14 23452 3 0.80 2.40
--------
7.40
Kedalene Chong
Hi,
Try this query:
SELECT T0.[ItemCode],
T1.[WhsName],
v0.[Quantity] [WhsTotal],
T0.[BatchNum],
SUM(CASE T0.[Direction] when 0 then 1 else -1 end * T0.[Quantity]) [Quantity] FROM IBT1 T0 INNER JOIN OWHS T1 ON T0.WhsCode = T1.WhsCode
INNER JOIN (SELECT T0.[ItemCode], T1.[WhsName],
SUM(CASE T0.[Direction] when 0 then 1 else -1 end * T0.[Quantity]) [Quantity]
FROM IBT1 T0 INNER JOIN OWHS T1 ON T0.WhsCode = T1.WhsCode
GROUP BY T1.[WhsName], T0.[ItemCode]) V0 ON T0.[ItemCode]=V0.[ItemCode] and t1.[WhsName]=v0.[WhsName] WHERE T0.[ItemCode] =[%0] GROUP BY T0.[BatchNum], T1.[WhsName], v0.[Quantity], T0.[ItemCode]
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.