Duplicates/Not duplicates

  • Thread starter Thread starter Anna
  • Start date Start date
A

Anna

Hi,

Is it possible to search for records that are duplicates
in some fields and NOT in another (e.g records with the
same DOB but not the same surname (leaving out those with
same DOB and surname))?
Does this make sense?

Thanks,

Anna
 
Hi,


SELECT a.*, b.*
FROM myTable As a INNER JOIN myTable As b
ON (a.DOB=b.DOB AND a.Surname>b.Surname)


Since if a <> b, we also have b<>a, but in this case, I assumed you wish to see the combination
just once, not twice, I used > instead of <>.


Hoping it may help,
Vanderghast, Access MVP
 
Thanks, I'll give it a bash!

Anna
-----Original Message-----
Hi,


SELECT a.*, b.*
FROM myTable As a INNER JOIN myTable As b
ON (a.DOB=b.DOB AND a.Surname>b.Surname)


Since if a <> b, we also have b<>a, but in this case, I
assumed you wish to see the combination
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top