on 2022 Apr 25 9:18 AM
Hi all,
Can someone give me a query for the requirement below:
"Committed stock report
This report asks the user to enter an item code and it reports back on all the open sales orders it is on sorted by date. this report is to help a customer to see what the committed stock levels are against an item and who they are committed to.
"Best Regards,DanielRequest clarification before answering.
Hi Daniel,
your query:
select
t0.DocNum as "SO Number"
,t0.CardCode as "Customer Code"
,t0.CardName as "Customer Name"
,cast(t0.DocDate as date) as "Posting Date"
,t1.ItemCode as "Item Code"
,t1.Dscription as "Item Name"
,t1.OpenQty as "Commited"
from ORDR t0
left join RDR1 t1 on t1.DocEntry = t0.DocEntry
where DocStatus = 'O'
and t1.ItemCode = [%0]
group by
t0.CardCode
,t0.CardName
,t0.DocNum
,cast(t0.DocDate as date)
,t1.ItemCode
,t1.Dscription
,t1.OpenQty
order by
cast(t0.DocDate as date)
is mostly fine, but I would also include t1.LineStatus in your WHERE clause, as a document can be opened but line closed (e.g. partial delivery was made). Also, I don't know why you are using cast on t0.DocDate, it should be shown as date in Query Manager.
BR,
Matija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
39 | |
8 | |
6 | |
5 | |
3 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.