S
Scott Morford
I am developing a weed management database for our preserve using Access 97.
Every time an employee visits and treats a weedpatch they make a entry that
is put into the database. We're trying to determine how our treatment is
working over time. To do this we need to be able to return a table that
contains the density information of each weed patch for the first visit of
the year because subsequent visits in the same year will show a lower
density (due to previous treatment), but not accurately describe the density
year to year for our research.
My treatment table contains the fields: RecordNumber (autonumber), Weed_ID
(number), Date (date/time type in serial format), and density (text).
I am trying to create two queries.The first query is to return the earliest
record of a user specified year for each Weed_ID. The second Query is to
return the earliest record of the most recent year in which there is a
record. Some weed_id have multiple records in a given year and others have
no records in a given year.
Here is an example of the table.
RecordNumber Weed_ID Date Density
1 1 20000506 Moderate
2 1 20010607 Moderate
3 1 20010615 Low
4 2 20000615 Moderate
5 2 20000620 Low
6 3 20000510 Moderate
7 3 20010520 Moderate
8 3 20030610 Moderate
9 3 20030620 Low
For the first Query I want to return the earliest record of a specified year
for each Weed_ID. For example if I specified year 2001 the query would
return the records 2 and 7.
For the second Query I want to return the earliest record of the most recent
year for each Weed_ID. The query would return records 2,4, and 8
Is this possible using the query builder or an SQL statement in Access 97
and how might I go about doing it?
Thanks in advance for any help.
Scott Morford
Pine Butte Swamp Preserve.
Every time an employee visits and treats a weedpatch they make a entry that
is put into the database. We're trying to determine how our treatment is
working over time. To do this we need to be able to return a table that
contains the density information of each weed patch for the first visit of
the year because subsequent visits in the same year will show a lower
density (due to previous treatment), but not accurately describe the density
year to year for our research.
My treatment table contains the fields: RecordNumber (autonumber), Weed_ID
(number), Date (date/time type in serial format), and density (text).
I am trying to create two queries.The first query is to return the earliest
record of a user specified year for each Weed_ID. The second Query is to
return the earliest record of the most recent year in which there is a
record. Some weed_id have multiple records in a given year and others have
no records in a given year.
Here is an example of the table.
RecordNumber Weed_ID Date Density
1 1 20000506 Moderate
2 1 20010607 Moderate
3 1 20010615 Low
4 2 20000615 Moderate
5 2 20000620 Low
6 3 20000510 Moderate
7 3 20010520 Moderate
8 3 20030610 Moderate
9 3 20030620 Low
For the first Query I want to return the earliest record of a specified year
for each Weed_ID. For example if I specified year 2001 the query would
return the records 2 and 7.
For the second Query I want to return the earliest record of the most recent
year for each Weed_ID. The query would return records 2,4, and 8
Is this possible using the query builder or an SQL statement in Access 97
and how might I go about doing it?
Thanks in advance for any help.
Scott Morford
Pine Butte Swamp Preserve.