Query
Hi,
I have witten the below query for goods receipt and batch to get batch cost.But it is not showing the correct records.
SELECT T0.DocNum, T0.DocDate, T0.CardCode, T1.DocEntry, T1.LineNum, T2.BatchNum, T1.ItemCode, T1.Dscription, T1.Quantity, T1.Price, T1.LineTotal, T1.LineNum, T2.LineNum FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN IBT1 T2 ON
T1.[ItemCode]=T2.[ItemCode] AND T1.[LineNum]=T2.[LineNum]
Can somebody help me to correct the query to get the correct records also i want the landed cost for the batch item to be shown in the report.
Rgds,
Rajeev
Former Member replied
try to execute your SELECT with "Distinct"
e.g.
SELECT DISTINCT T0.DocNum, T0.DocDate, T0.CardCode, T1.DocEntry, T1.LineNum, T2.BatchNum, T1.ItemCode, T1.Dscription, T1.Quantity, T1.Price, T1.LineTotal, T1.LineNum, T2.LineNum FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN IBT1 T2 ON T1.ItemCode=T2.ItemCode AND T1.LineNum=T2.LineNum