How can i link the OIQR and IQR1 table with OJDT,JDT1,OINM table?
Since I want to get the cal price at OINM table.
What do i need to add to get the calcprice of the item according to their Doc Date (stock posting) in OIQR
OnHandBef as Instock,Quantity as different, OINM.Calcpric*quantity as COGS
INNER JOIN dbo.IQR1 ON dbo.OIQR.DocEntry = dbo.IQR1.DocEntry
inner join dbo.OWHS on dbo.OWHS.whscode = dbo.IQR1.WhsCode
inner join dbo.OINM on dbo.OINM.TransType= dbo.OIQR.ObjType
and dbo.OINM.DocDate= dbo.OIQR.DocDate
and dbo.OINM.CreateDate = dbo.OIQR.CreateDate
order by WhsCode, DocDate,IQR1.ItemCode