Nulls in Query

D

Dan @BCBS

Other than creating a "Find Duplicates Query" is there a simple way to find
dups in a query..
Something like: Criteria = "no dups"
 
M

Michel Walsh

Hi,


You can make GROUP BY with all the fields defining what you mean to consider
in "dup", and add a HAVING clause on the count:


SELECT f1, f2, LAST(f3)
FROM myTable
GROUP BY f1, f2
HAVING COUNT(*) <> 1



here, from fields f1, f2, and f3, only the first two are important, ie, you
want to get records that have the couple (f1, f2) have duplicated values.



Hoping it may help,
Vanderghast, Access MVP
 
Top