M
Meredith Bliss
Using Access 2007, I've recently encountered a problem where a query returns
the expected number of results, but the wrong records. If I edit the SQL
query to say "SELECT DISTINCT" instead of "SELECT", I get the expected
results (or if I do an aggregate query).
Based on my limited testing, it appears that with the SELECT query, the
records are all populated with the first record from the table with a
matching value in the table's index field. These records may (but mostly do
not) agree with the selection criteria in the WHERE clause. (Of course if
they did match the criteria, it wouldn't be a problem ... duh.)
Presumably, this wouldn't be a problem selecting records from a table where
the index field had unique values. But should a unique values index be
necessary for the WHERE clause to select the desired records???
Thanks for any thoughts on this,
the expected number of results, but the wrong records. If I edit the SQL
query to say "SELECT DISTINCT" instead of "SELECT", I get the expected
results (or if I do an aggregate query).
Based on my limited testing, it appears that with the SELECT query, the
records are all populated with the first record from the table with a
matching value in the table's index field. These records may (but mostly do
not) agree with the selection criteria in the WHERE clause. (Of course if
they did match the criteria, it wouldn't be a problem ... duh.)
Presumably, this wouldn't be a problem selecting records from a table where
the index field had unique values. But should a unique values index be
necessary for the WHERE clause to select the desired records???
Thanks for any thoughts on this,