SELECT A.*
FROM yourTable A INNER JOIN (
SELECT Field1, Field2 FROM yourTable GROUP BY Field1, Field2 HAVING Count(*) > 1
) B ON A.Field1 = B.Field1 AND A.Field2 = B.Field2
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Normally i dont do a query to do this I just import directly into table. So my understanding is that if I want to add another record to the table and check to different fields for duplicate value it is best to add it thru a form and add the SQL statement in a query. There is no way just to have same effect by just importing an outside file directly into the table. But the reason i do it this way is I am adding 100-500 records at a time.
I dont think i am explaining properly I need to match 2 fields to find a duplicate record. Please see example below:
field1 field2 field2 field4
7354 edrrt ertfd sw1 add this
7390 ftyui edrty sw1 add this
7390 edrft ghxsw sw2 cause field1 is the same but
field4 is different
7390 aaaaa bbbbb sw1 do not add because
field1 and field4
exsist already above
I can check data in 1 field also but someone said it could be done on based on looking at 2 fields so thats why i am here. Thank you for your help anyway.
You didn't answer my question.
You claim you know how to check data in 1 field.
So, please, say us how you do that. This will help us explaining you (with your terms) how to do the same with 2 fields.
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.