on 2009 Jan 29 11:28 AM
Hi,
Please let me know if any one has query for inventory ageing for Batch management item.
regards
Suresh S
Hi Suresh,
Wouldn't it be a simple query from OIBT table, there you've item code, batch number, in date for that batch, and quantity.
Should be something like this:
SELECT T0.WhsCode, T0.ItemCode, T0.ItemName, T0.BatchNum, T0.CreateDate,
DateDiff(dd, T0.CreateDate, GetDate()) As Days, T0.Quantity
FROM OIBT T0
WHERE T0.Quantity > 0
ORDER BY T0.WhsCode, T0.ItemCode, T0.CreateDate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use following query:
SELECT T0.WhsCode, T0.ItemCode, T0.ItemName, T0.BatchNum, T0.CreateDate,
DateDiff(dd, T0.CreateDate, GetDate()) As Days, T0.Quantity,
case when (datediff(dd, createdate, getdate())<=30) then 'Upto 30 Days'
when (datediff(dd, createdate, getdate())>30 and datediff(dd, createdate, getdate())<=60) then '31 to 60 Days'
when (datediff(dd, createdate, getdate())>60 and datediff(dd, createdate, getdate())<=90) then '61 to 90 Days'
else 'More than 90 Days'
end as days
FROM OIBT T0
WHERE T0.Quantity > 0
ORDER BY T0.WhsCode, T0.ItemCode, T0.CreateDate
Edited by: Rahul Jain on Jan 30, 2009 10:28 AM
User | Count |
---|---|
102 | |
8 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.