Query Math help

S

Stacy

I have a table with multiple species of animals and their measurements for
multiple locations. I am trying to use field:animal average:
IIf([species]="a",[length],0) total:avg to obtain average measurements for
each species. But what happens is the average totals up the lengths of only
species "a" (which is correct) but then averages it over the total number of
species instead of just the number of species "a". i.e I have 3 individuals
of species "a" and 4 of species "b" it adds up the 3 lengths of "a" but then
averages that sum over 7 instead of 3.
How can I only get an average of the species I want and/or is there a
different way to do this.

Thank you for any help.
 
A

Allen Browne

1. Create a query using this table.

2. Depress the Total button on the toolbar.
Access adds a Total row to the query design grid.

3. In the Total row under the species field, accept Group By.
In the Total row under length, choose Average.
 

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