A family of Microsoft relational database management systems designed for ease of use.
Use a totals (aggregate) query that groups only by the fields that define a unique species at a location, and put the date restriction in the criteria for the date field.
In Design view of the query:
- Add the table that contains the shots (Slides 1) and any lookup tables that define species.
- Add these fields to the grid:
- LOCATION (from Slides 1)
- SPECIES (from Slides 1 or the related table that uniquely identifies a species)
- DATE_1 (the date the shot was taken)
- On the Design tab, click Totals so the Total row appears.
- Set the Total row as follows:
- LOCATION: Group By
- SPECIES: Group By
- DATE_1: Where
- In the Criteria row under DATE_1 enter the date condition, for example:
-
<= #12/31/1989#(all shots before 1990)
-
- Add a new column to count distinct species per location:
- Field:
SpeciesCount: SPECIES - Total: Count
- Field:
This design:
- Filters records to only those at Montrose (keep
LOCATIONcriteria likeLike "Montrose*"if needed). - Restricts records to dates before 1990 via the Where clause on DATE_1.
- Groups by LOCATION and SPECIES so each species at that location is counted once.
- Uses Count to return the number of species, not every instance.
If duplicates still appear, add additional grouping fields that distinguish species (for example, SUBJECT or an identifier) or use a separate totals query first to get unique species per location, then base a second query on that totals query to count the rows.
References: