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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extract duplicates in 2 fields with same 6 characters 2

Status
Not open for further replies.

julius1

Technical User
Oct 31, 2002
142
US
Is there a way to set up criteria in a query that will locate duplicates of records based on 2 fields using the 1st 6 characters in both fields to find the match with?
Like I have 2 fields, one Aloc the other Zloc, between the 2 there are several that show the same 1st 6 characters. How can the criteria be set up to only return those that are the same between both fields but only counting up to the 1st 6 characters.

For example.
Aloc Zloc
WNVLMOXA WNVLMOXAK04
BASNMOXAK04 BASNMOXAH31

the 1st 6 characters are the same and that is what I am wanting to show in results. There are several variances, but the same theroy. I am lost trying to get just the duplicate results to populate based on 1st 6 characters.

julius.gazdag@centurytel.com
Im a Telco guy, I can get you where you want to go, but I can't guarantee it will work when you get there!
 
SELECT tbl.Aloc, tbl.Zloc
FROM tbl
WHERE (((Left(tbl.Aloc,6))= Left([tbl].[Zloc],6)));

This should do it.

Paul
 
This should work

SELECT * from [Table1]
Where left(Table1.Aloc,6)=left(Table1.Zloc,6);
 
Do I just drop that into my criteria?

julius.gazdag@centurytel.com
Im a Telco guy, I can get you where you want to go, but I can't guarantee it will work when you get there!
 
Here is my current statement. I know it's way off, but:
SELECT [A Z CLLI Compare].div, [A Z CLLI Compare].ckr, [A Z CLLI Compare].type, [A Z CLLI Compare].juris, [A Z CLLI Compare].aloc, [A Z CLLI Compare].zloc
FROM [A Z CLLI Compare];


julius.gazdag@centurytel.com
Im a Telco guy, I can get you where you want to go, but I can't guarantee it will work when you get there!
 

SELECT [A Z CLLI Compare].div, [A Z CLLI Compare].ckr, [A Z CLLI Compare].type, [A Z CLLI Compare].juris, [A Z CLLI Compare].aloc, [A Z CLLI Compare].zloc
FROM [A Z CLLI Compare]
WHERE left([A Z CLLI Compare].aloc,6)=left([A Z CLLI Compare].zloc,6);
 
SELECT [A Z CLLI Compare].div, [A Z CLLI Compare].ckr, [A Z CLLI Compare].type, [A Z CLLI Compare].juris, [A Z CLLI Compare].aloc, [A Z CLLI Compare].zloc
FROM [A Z CLLI Compare]
WHERE Left([A Z CLLI Compare].Aloc,6) = Left([A Z CLLI Compare].Zloc,6);

Should do it.

Paul
 
Thank you very very much guys!!!!!!!!

julius.gazdag@centurytel.com
Im a Telco guy, I can get you where you want to go, but I can't guarantee it will work when you get there!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top