Ahhh... I can't figure this out, can someone help?
I'm using Access 2003.
I have 2 tables here:
One is for each person, called tblPartners.
One is for each distribution by a partner, called tblDistributions
In tblPartners there is a field called ClosingBalance.
What I want to do is UPDATE ClosingBalance to equal the sum of
distributions by that partner for a period.
So what I originally did was try
UPDATE tblPartners LEFT JOIN tblDistributions
ON tblPartners.PartnerID = tblDistributions.PartnerID
AND tblPartners.Period= tblDistributions.inPeriod
SET tblPartners.ClosingBalance = SUM(tblDistributions.DistribAmt)
But this gives the error "You tried to execute a query that does not
include the specified expression 'ClosingBalance' as part of an
aggregate function."
I also tried:
UPDATE tblPartners
SET ClosingBalance = TotalDistribs
FROM tblPartners INNER JOIN tblDistributions
(SELECT SUM(DistribAmt) AS TotalDistribs, PartnerID, inPeriod
FROM tblDistributions GROUP BY PartnerID, inPeriod)
ON tblPartners.PartnerID = tblDistributions.ParnterID AND
tblPartners.Period = tblDistributions.inPeriod
But gives a syntax error.