Hi all,
I'm having difficulty with the syntax in this query to remove duplicate data for the field "StocktransID". Any help is greatly appreciated.
I'm having difficulty with the syntax in this query to remove duplicate data for the field "StocktransID". Any help is greatly appreciated.
Code:
SELECT DISTINCT tblStockTrans.StockTransID, tblItem.Brand, tblItem.Category, tblItem.SubCategory,
tblItem.Model, tblItem.Description, IIf(TransTypeID=3,Quantity*-1,Quantity) AS Qty,
tblTransaction.TranstypeID, tblItem.ItemID, tblTransaction.TransactionID, tblItem.ItemType,
tblItem.Origin, tblOption.ParentID
FROM tblTransaction INNER JOIN ((tblItem LEFT JOIN tblOption ON tblItem.ItemID = tblOption.ItemID)
INNER JOIN tblStockTrans
ON tblItem.ItemID = tblStockTrans.ItemID) ON tblTransaction.TransactionID = tblStockTrans.TransID
GROUP BY tblItem.Brand, tblItem.Category, tblItem.SubCategory, tblItem.Model, tblItem.Description,
tblTransaction.TranstypeID, tblItem.ItemID, tblTransaction.TransactionID, tblItem.ItemType,
tblItem.Origin, tblOption.ParentID, tblStockTrans.StockTransID, tblStockTrans.Quantity,
tblTransaction.location1