When I add this line to the select statement, I break it.
SUM(CPSTransaction.AuthorizationAmount - ((55 * COUNT(Guest.GuestRegID) + 100))) as Total_Due
Error:
Cannot perform an aggregate function on an expression containing an aggregate or a subquery.
I would appreciate any help with this.
Thanks.
Microsoft AccessC#SQL
Last Comment
javierpdx
8/22/2022 - Mon
mbizup
What exactly are you trying to do?
Your question title mentions multiplying two columns, but the expression that you are having trouble with is not multiplying them.
You will have to transform the formula to use no aggregates in aggregates. Sum(count()) is the issue.
Qlemo
The formula does not make sense to me. Arithemetic transformation leads to
sum(CPSTransaction.AuthorizationAmount)
+ count(*)*100
+ count(Guest.GuestRegID)*count(*)*55
which doesn't look reasonable.
I'm trying to multiple COUNT(Guest.GuestRegID) by 55, then add 100 to it.
Then subtract this value from Sum(CPSTransaction.AuthorizationAmount) to get the total still due.
Your question title mentions multiplying two columns, but the expression that you are having trouble with is not multiplying them.
>>> SUM(CPSTransaction.Authori
Should the minus sign be a multiplication sign?
SUM(CPSTransaction.Authori