I want year in one table to be less or equal year in another table

  • Thread starter Thread starter Cecilia
  • Start date Start date
C

Cecilia

Hi

I have some problems writing a query and I hope someone can help me.

I have a database with serveal tables. In one table I have this information,
Lake ID-number, treatment, year for treatment. In another table I have Lake
ID-number, fish species (I am intrested in pike), year when pike is present.
I want to find all lakes that have pike present before the treatment was
done, I want the year in the second table to me less or equal the year in the
first table. Is there a easy way to do this?

Thanks
 
Try something like this substituting your table and field names.

SELECT tblTreatments.DateTreated, Year([DatePresent]) AS YearSpeciesPresent,
tblSpecies.Species
FROM tblTreatments INNER JOIN tblSpecies ON tblTreatments.LakeID =
tblSpecies.LakeID
WHERE (((Year([DatePresent]))<=Year([DateTreated])) AND
((tblSpecies.Species)="Pike"));

Regards

Kevin
 
Back
Top