Sum after Count Query

D

Dasin

Using Access 2003
I have a table that contains an Area (City) list. I have a query that
runs against this list to break down the Areas and count how many times
this Area appears in the list. Example:

Area1 3
Area2 6
Area3 15

And so on. Now I need to total each separate area by name and total of
that area. I have tried adding a Sum query to that query but I am
getting the Mis match error. Do I need to run a new separate query? Or
can I combine it all in one?

Any help appreciated.
 
S

Smartin

Dasin said:
Using Access 2003
I have a table that contains an Area (City) list. I have a query that
runs against this list to break down the Areas and count how many times
this Area appears in the list. Example:

Area1 3
Area2 6
Area3 15

And so on. Now I need to total each separate area by name and total of
that area. I have tried adding a Sum query to that query but I am
getting the Mis match error. Do I need to run a new separate query? Or
can I combine it all in one?

Any help appreciated.

You can get counts and sums in the same query.

Is the field that you are summing defined as numeric? What does your
data look like?
 
D

Dasin

The numbers I am trying to sum come from the Count part of the Query
and I don't know where Access stores these results so I am guessing
that they are numeric by default. My data is a list of Cities which is
pulled from a drop down list. When I do the count I get a query result
of the list of Cities and how many times each was listed, such as
Dallas - 15, Allen - 4 and so on. When I try a sum I get data
mismatched and I am using Sum: AreaList for the top line in the query
design box, table name, on the Total line I am using Sum and that is
about how far I have been able to go.
Any help appreciated!
 
S

Smartin

I am using Sum: AreaList for the top line in the query

Is AreaList a numeric field? If so, see next.

"Sum" is a reserved word -- best not to use it as an alias. Try
something like "AreaSum: AreaList" instead. You will need to adjust
other parts of your queries that refer to this field by name also.

If AreaList is not numeric, did you mean to apply a Count (in the Totals
spec for this field) instead?
 

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