Sum values for records with more than one similar field

G

Guest

In the detail part of a report I would like to show the sum the data for all
the records which have more than 2 fields in common. The report is based on
a query. My fields are Genus, Species, Location, Quantity. I would like my
report to give a single result with total quantity for all records that have
the same Genus, Species, and Location.

I have tried a few things to no avail. Probably a simple answer but its
driving me nuts. Any help would be much appreciated.
 
D

David Lloyd

For the Record Source of the report you could use a query similar to the
following:

SELECT Genus, Species, Location, Sum([Quantity])
FROM MyTable
GROUP BY Genus, Species, Location

A query such as this will create one entry for each unique combination of
Genus, Species, Location, and give the total quantity for each combination.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


In the detail part of a report I would like to show the sum the data for all
the records which have more than 2 fields in common. The report is based on
a query. My fields are Genus, Species, Location, Quantity. I would like my
report to give a single result with total quantity for all records that have
the same Genus, Species, and Location.

I have tried a few things to no avail. Probably a simple answer but its
driving me nuts. Any help would be much appreciated.
 

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