Hey Mike,
You probably want to store the value to a variable then use that...
CREATE Trigger AvailableLogFootage
on tblLogs
FOR INSERT
As
DECLARE @TotalFootage int
SELECT @TotalFootage = SUM(tblBundles.CurrentFootage)
FROM tblBundles
UPDATE tblLogs
Set UnDesignatedFootage = @TotalFootage
FROM tblLogs
INNER JOIN tblBundles ON tblLogs.FlitchNum = tblBundles.FlitchNum
WHERE tblBundles.IsDesignated = 'N'
HTH,
John
"MrMike" <Mr****@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
I'm having an issue with an aggregate function in line 6 of the code
below. The error is: "An aggregate may not appear in the set list of an UPDATE
statement."
How can i SUM this value successfully? Thanks experts.
CREATE Trigger AvailableLogFootage
on tblLogs
FOR INSERT
As
UPDATE tblLogs
Set UnDesignatedFootage = Sum(tblBundles.CurrentFootage)
FROM tblLogs
INNER JOIN tblBundles ON tblLogs.FlitchNum = tblBundles.FlitchNum
WHERE tblBundles.IsDesignated = 'N'