Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DUPLICATE NAMES

Status
Not open for further replies.

IFORD

Technical User
Sep 21, 2004
32
US
I'm check for duplicate names in a query that has 2 tables base on last name fields for each table in some cases its listing as a duplicate name but the fields are exactly the same but the query said it a duplicate. And I can not figure it out

example importcustomer lastname childrose
tblcustomer lastname childrose
and the query says its a duplicate

Thanks for any help Irene
 
>... the fields are exactly the same but the query said it a duplicate

Isn't "exactly the same" the definition of "duplicate"?
I don't understand.

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Yes it is, sometimes I just word things wrong and this is one of those times. I'm really looking for names that are not duplicates. And when I run this query I have names come up like childrose that should not be on the list

SELECT IMPORTCUSTOMER.*, IMPORTCUSTOMER![ADDRESS 1] Like tblCustomer!ADDRESS AS Expr1, IMPORTCUSTOMER.[ADDRESS 1]
FROM IMPORTCUSTOMER INNER JOIN tblCustomer ON IMPORTCUSTOMER.[NAME ID] = tblCustomer.CUSTNO
WHERE ((([IMPORTCUSTOMER]![LASTNAME] Like [tblCustomer]![LASTNAME])=0));

and this is what i'm getting

NAME ID FIRSTNAME MIDDLENAME IMPORTCUSTOMER.LASTNAME Expr1 tblCustomer.LASTNAME Field0
14078 LUIS A MOLINA -1 "MOLINA
MOLINA" 1509 ISAACS CT

But in posting this thread i see my error in the database I dont see that molina in the tblcustomer.lastname is in there 2 time But when I cut and paste i see my error. Thank you for all your help irene
 
Use more than lastName, try lastName and firstname. You can also make it Distinct. See if this help any.
 
Select first_name, last_name from table
group by first_name, last_name having count(*) = 1;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top