troubleshooting Question

Error trying to sum values in an update statment

Avatar of kpwhitte
kpwhitte asked on
Windows XPWindows OSSQL
3 Comments1 Solution176 ViewsLast Modified:
Now i need to sum values from two different CostCodeTypes. Following is my code

update jc
set Equipment = sum (cc.Committed)
from JobCostCommitted jc
inner join qry_Const_JobDetail_CommittedCosts_Sum cc
on cc.JobNumber = jc.JobNumber
where cc.CostCodeType in ('E','T')

here is the error I get
Server: Msg 157, Level 15, State 1, Line 2
An aggregate may not appear in the set list of an UPDATE statement.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros