Skip to Content
0
Former Member
Aug 20, 2008 at 04:55 AM

How can i join PO with GRPO

544 Views

Hi,

I make query as belown to join PO with GRPO.I wnat to calculate Quantity from PO to GRPO but in my query it show duplicate record i also use distinct but useless.My query as below.

SELECT T1.DocNum [PO No], T1.DocDate [PO Date], T3.ItemCode, T3.Dscription, T3.U_CostCentre, T3.DocEntry [GRN No], T0.DocDate [GRN Date],T3.Quantity'GRIR Quantity',T2.Quantity 'PO Quantity',

T3.Quantity-T2.Quantity 'Balance Quantity'

FROM OPDN T0 , OPOR T1, POR1 T2, PDN1 T3

WHERE T1.DocEntry = T2.DocEntry

and T0.Docnum = T3.Docentry

and T3.BaseRef = T1.DocNum

and T2.ItemCode = T3.ItemCode

and T3.DocDate between [%0] and [%1]

Can any body help in this regards.

Sohail Anwar Ali