you tried to execute a query that does not include the specified expression ... as part of the aggregate function

Good morning!  I have what I hope is an easy question for many of you experts.

When executing this query, I get the error: “you tried to execute a query that does not include the specified expression ‘CompID’ as part of the aggregate function”

SELECT PC.TagNum, Sum(Software.SoftCost) AS SumOfSoftCost
FROM Software, PC
WHERE (((PC.TagNum)=[SoftWare].[TagNum]))
GROUP BY Software.TagNum;

I'm just learning, and muddling my way through, so I appreciate the help.  Are there general rules of thumb that I should know when it comes to Aggregate functions?
thanks!
LVL 8
ksearchAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LowfatspreadCommented:
try
SELECT PC.TagNum, Sum(Software.SoftCost) AS SumOfSoftCost
FROM Software, PC
WHERE (((PC.TagNum)=[SoftWare].[TagNum]))
GROUP BY PC.TagNum;

ingeneral the Group by must contain the same columns that you specify on the Select Statement (including the table..)

 
however it isn't clear where ‘CompID’  comes into play?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ksearchAuthor Commented:
Yay for LowFatSpread!  that did it. Thanks!  Calling the wrong field in the groupby property was the problem. Thanks so much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.