on 2019 Aug 30 8:17 AM
Dear Experts,
We have devised this query by using query generator and when executed, the item nos are repeating even though we have used the "Distinct" function. please help us.
SELECT DISTINCT T0.DocEntry,T0.[DocNum], T0.[PostDate], T0.DueDate, T0.[ItemCode], T0.[PlannedQty], T1.[ItemCode], T1.[PlannedQty], T3.OnHand, T0.Status, T1.[IssuedQty], T0.Comments FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode inner JOIN OITW T3 ON T1.[ItemCode] = T3.[ItemCode] WHERE T1.[IssuedQty]<=0 and (T0.[Status] ='P' or T0.[Status] ='R') ORDER BY T0.[PostDate]
Can anyone please help us?
Regards.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hello Mekhala P,
Problem with OITW, it contains items with all warehouse onhand quantity.
You have to join warehouse code of T1 with WhsCode of OITW T3 like
OITW T3 ON T1.[ItemCode] = T3.[ItemCode] and T1.warehouse=T3.WhsCode
Regards,
Zuber Kazi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
11 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.