Hi all,
On this code:
SELECT
SupplierAccNo, GRNInDate, AccountNo, SubAddressCode, SUM (Value)
FROM
tbGRNHistory
LEFT JOIN tbPOrderHistory ON tbGRNHistory.PONumber=tbPOrderHistory.PONumber
LEFT JOIN tbOrderHistory ON tbPOrderHistory.SONumber=tbOrderHistory.SONumber
WHERE
tbGRNHistory.SupplierAccNo='OCS336'
GROUP BY
SupplierAccNo, GRNInDate, AccountNo, SubAddressCode
When I [SUM (Value)] as above I get inaccurate results of hundreds of thousands of $ in a few dozen rows of data.
When I remove the [SUM] from [Value]and put [Value] in [GROUP BY] the values are correct but it does not sum together the values and has hundreds of data rows of small amounts.
How do I have a few dozen lines of correctly summed data?
Many thanks, D