Hello experts. I have a table called TelephoneAAA. I should run a query to find duplicate records based on a Field called ADI and a second query to do the same based on a field called SOYADI. I have used the Access query creation wizard To create both queries. Individually they work, but I want to get an intersection of the two queries that never works. Here is the code:
Please help
Code:
SELECT TelephoneAAA.ADI, TelephoneAAA.SOYADI, TelephoneAAA.TEL, TelephoneAAA.ADRES, TelephoneAAA.DateOfUpdate
FROM TelephoneAAA
WHERE (((TelephoneAAA.ADI) In (SELECT [ADI] FROM [TelephoneAAA] As Tmp GROUP BY [ADI] HAVING Count(*)>1 And [ADI] = [TelephoneAAA].[ADI])))
ORDER BY TelephoneAAA.ADI, TelephoneAAA.SOYADI
INTERSECT
SELECT TelephoneAAA.ADI, TelephoneAAA.SOYADI, TelephoneAAA.TEL, TelephoneAAA.ADRES, TelephoneAAA.DateOfUpdate
FROM TelephoneAAA
WHERE (((TelephoneAAA.SOYADI) In (SELECT [SOYADI] FROM [TelephoneAAA] As Tmp1 GROUP BY [SOYADI] HAVING Count(*)>1 And [SOYADI] = [TelephoneAAA].[SOYADI])))
ORDER BY TelephoneAAA.ADI, TelephoneAAA.SOYADI;