Hi experts,
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
select OIGR.Docdate,IGR1.WhsCode,WhsName,IQR1.ItemCode,ItemName,
OnHandBef as Instock,Quantity as different, OINM.Calcpric*quantity as COGS
FROM dbo.OIQR
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