M
margaret
I'm confused. When I try to execute the following query:
SELECT tblSales.game, tblSales.fairdate, tblSales.amount, tblSales.cash,
tblSales.ctrlyear, tblSales.DAYOFFAIR, gamemaster.gname,
IIf([CTRLYEAR]=[First Year?],Sum([amount])) AS currentamt,
IIf([CTRLYEAR]=[Second Year?],Sum([amount])) AS previousamt
FROM gamemaster INNER JOIN tblSales ON gamemaster.game = tblSales.game;
I get this message:
You tried to execute a query that does not include the specified expression
'game' as a part of an aggregate function. However, if I remove the
"currentamt" and the "previousamt", the query will work? Why?
Thanks for any help.
SELECT tblSales.game, tblSales.fairdate, tblSales.amount, tblSales.cash,
tblSales.ctrlyear, tblSales.DAYOFFAIR, gamemaster.gname,
IIf([CTRLYEAR]=[First Year?],Sum([amount])) AS currentamt,
IIf([CTRLYEAR]=[Second Year?],Sum([amount])) AS previousamt
FROM gamemaster INNER JOIN tblSales ON gamemaster.game = tblSales.game;
I get this message:
You tried to execute a query that does not include the specified expression
'game' as a part of an aggregate function. However, if I remove the
"currentamt" and the "previousamt", the query will work? Why?
Thanks for any help.