aggregate function error

G

Guest

SELECT x, y ,Sum(x) AS total, a, b
FROM T1 INNER JOIN T2 ON T1.num= T2.num
WHERE x=[forms]![branch 1]![text34] AND y=[forms]![branch 1]![text15] And
a=[forms]![branch 1]![text28];


when i place the aggregate function in the query, i get an error saying
that i tried to execute a query that does not include the specified
expression " x " as part of the aggregate function. When I remove the x
field, i get the same error, but instead of x, its y.
 
J

John Spencer

Any fields that you aren't using SUM, Avg, etc on must be grouped by

SELECT x, y ,Sum(x) AS total, a, b
FROM T1 INNER JOIN T2 ON T1.num= T2.num
WHERE x=[forms]![branch 1]![text34] AND y=[forms]![branch 1]![text15] And
a=[forms]![branch 1]![text28]
GROUP BY x,y,a,b
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top