SELECT Parts.ShortID AS PART, Parts.Description AS DESCRIPTION, Sum(PartsActive.Units) AS UNITS, Parts.curCost AS [CURRENT COST], Sum(Parts.curCost*PartsActive.Units) AS TOTAL, PartsActive.[Date In] AS DateIn, MatOut.Date AS DateOut
FROM (Parts RIGHT JOIN ((PartsActive LEFT JOIN Vendor ON PartsActive.Associate = Vendor.Rec) LEFT JOIN tblCompanyInfo ON PartsActive.WID = tblCompanyInfo.Rec) ON Parts.PartNo = PartsActive.Part)
LEFT JOIN MatOut ON ( PartsActive.Part = MatOut.PartNo AND MatOut.Date = DMAX("Date", "MatOut", "PartNo = " & PartsActive.Part ))
GROUP BY Parts.ShortID, Parts.Description, Parts.curCost, PartsActive.[Date In], Vendor.Name, PartsActive.Active, Parts.DC, MatOut.Date;
|