calculating sum

B

Bob Griendling

I'm designing a report based on a query. The report lists precincts and how
two candidates fared in each:

Precinct
cand A # votes
cand B # votes

At the end of thee report I simply want a total for each candidate:

District Total
cand A # votes
cand B # votes

I think I need to put it in a report footer, but can't figure it out. When
I put in a field for cand, it gives me only one candidate.

How do I do that?
 
D

Duane Hookom

Create a totals query that Groups by Candidate and District. Use this query
as the record source for a subreport to place in your report footer.
 
B

Bob Griendling

It's the "group by" part I can't seem to get, even when I read the help
section for calculating sums in queries.
 
B

Bob Griendling

Can you translate this?

Cannot group on fields selected with '*'. (Error 3121)
You tried to execute a SELECT statement that groups or totals all fields
from all tables, selected with an asterisk ( * ).

Possible cause:

a.. You created an SQL statement that includes an aggregate function or
GROUP BY clause that refers to a field you selected with an asterisk. This
error occurs, for example, if you enter the following SQL statement:
SELECT * FROM Orders GROUP BY ShipVia;
============================
 
J

John Spencer

Check the query properties. You probably have show all fields set to yes
(true).

If you can't see it there, open the query in SQL view and in the SELECT
clause look for an asterisk (*) and delete it.
 
D

Duane Hookom

View the Properties dialog of your query while in design view. Make sure the
Return all Fields property is set to "No".
 

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