473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Duplicate value

Hi
I have a problem with duplicate values.
in my table i have some customer that have more than 1 id. i can fine them with find duplicate values. but the problem is that i want to find those customer that one of their id is started with 2233 and the other one is started with 2234.
but with "Find Duplicate Query Wizard" i will find any customer that has more than one record. i just want those customer that one of the id is tsrtaed with 2233 and the other one is 2234.

i would appreciate any suggestion.

thanks
Mar 25 '08 #1
2 1414
Stewart Ross
2,545 Expert Mod 2GB
Trying to find customers with multiple IDs is a bit tricky. You need to identify them from non-unique alternative fields, and some manual filtering may be required to sieve out false positive matches.

Create a new query into which you insert TWO copies of your customer table. Access will alias the second copy as customer_1 or similar to distinguish it from the first copy.

Join the two copies of the customer table on the customer forename and surname fields, and add the name fields, ID and any others you want to check from one of the two tables. Order the query by surname and Forename.

In one of the criteria fields for the unique customer ID field place the following criterion:
<> [customer_1].[customer ID]
(replacing the table and field names as appropriate for your situation).

Save the query and run it. It will return all rows where the names match but the IDs do not.

Example SQL for the query is listed below.

Expand|Select|Wrap|Line Numbers
  1. SELECT [Customer].[Customer ID], [Customer].[Surname], [Customer].[Forename]
  2. FROM [Customer] INNER JOIN [Customer] AS [Customer_copy]
  3. ON ([Customer].[Forename] = [Customer_copy].[Forename]) AND ([Customer].[Surname] = [Customer_copy].[Surname])
  4. WHERE ([Customer].[Customer ID)<>[Customer_copy].[Customer ID])
  5. ORDER BY [Customer].[Surname], [Customer].[Forename];
-Stewart
Mar 26 '08 #2
Hi
thanks alot for your solution. i think i understood, what to do.
thank you 10000000000000000000000000000000000 times
Mar 26 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Lowell Kirsh | last post by:
I have a script which I use to find all duplicates of files within a given directory and all its subdirectories. It seems like it's longer than it needs to be but I can't figure out how to shorten...
1
by: marx | last post by:
I have a bit of a problem and any help would be much appreciated. Problem: I have two dropdown list boxes with same data(all data driven). These are used for two separate entries. For every...
3
by: ColinWard | last post by:
I am using the following code to validate that the person that is being entered into the database does not already exist. However wnem I test it by entering myself as a contact(I first checked that...
3
by: Nhmiller | last post by:
I searched here for an answer. I am entering records into a database, and it would save a lot of time if I could duplicate a record that is very similar to the new one I am about to enter, then...
4
by: FangQ | last post by:
hi I am very new to mysql. I have a question about using the "on duplicate update" clause with insert command. my table "data" has two columns, field1 and field2, where field1 is the index...
4
by: afr0ninja | last post by:
Hello! I'm still rather new to using code in access. I've come across a problem that I'm having difficulty troubleshooting. Any assistance would be greatly appreciated! I've set up a form...
0
by: claus | last post by:
Hi, I am not a programmer but tries anyway to program a feature in a form where I am able to copy entries for the form and a subform. I have tried follow the guide here...
4
by: ravir81 | last post by:
Hi, I am currently working on excel validation using Perl. I am new to Excel validation but not for Perl. I have a question regarding one of the validation. Could anyone please tell me how to get...
4
by: AXESMI59 | last post by:
have a project in which I am entering Serial Numbers and Date codes into a Combo box. Serial numbers are all different. However, they could each have the same Date Code. Each Serial Number has a...
1
by: xraive | last post by:
I have a problem with this. Currently I am trying Allen's code and i am not successful. Current Design Table1 (Main Form) TravelID (PK) ApprovedBY EntreredBy BudgetCode ExpenseCode
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.