Hi, in MS Access, I am looking for an efficient way of returning records where field values in one table are NOT present when compared to another table. I can do this using NOT EXISTS or NOT IN but they take for ever to run.
I've been looking a LEFT and RIGHT JOINs but have destroyed too many brain cells in the process and am now totally confused !
I have two tables (that describe Bird Populations as it happens!).
The relevant fields in the main Bird Sightings table (Table 1) are SPECIES, SQUARE and TETRAD which describe very many bird species sightings and the 2k geograpical squares (Square and Tetrad) they were seen in.
Table two contains fields SQUARE, TETRAD and a FLAG that lists all possible SQUARES and TETRADs in and around the County where a Y in the flag field denotes the tetrad being wholly within the county boundary.
I'd like to be able to select SPECIES, SQUARE and TETRAD identifying those SQUAREs and TETRADs where the Species has no sightings (for FLAG "Y" Tetrads only).
Could anybody suggest the most efficient SQL to do this please?
Many thanks in anticipation
Phil Davis
I've been looking a LEFT and RIGHT JOINs but have destroyed too many brain cells in the process and am now totally confused !
I have two tables (that describe Bird Populations as it happens!).
The relevant fields in the main Bird Sightings table (Table 1) are SPECIES, SQUARE and TETRAD which describe very many bird species sightings and the 2k geograpical squares (Square and Tetrad) they were seen in.
Table two contains fields SQUARE, TETRAD and a FLAG that lists all possible SQUARES and TETRADs in and around the County where a Y in the flag field denotes the tetrad being wholly within the county boundary.
I'd like to be able to select SPECIES, SQUARE and TETRAD identifying those SQUAREs and TETRADs where the Species has no sightings (for FLAG "Y" Tetrads only).
Could anybody suggest the most efficient SQL to do this please?
Many thanks in anticipation
Phil Davis
Comment