473,770 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Find duplicates in another table

8,435 Recognized Expert Expert
Hi all.

Sorry, this is probably a really simple one but I'm having some difficulty with it, and don't have much time to devote to it right now.

I need to find all the records which have duplicates (on two fields) in another table. In Access 2003, the "Find duplicates wizard" will produce a query to list duplicates within the one table, but what about when they're in a different one?

In other words, I want to select all records in table T1 who have values in fields F1 & F2 which are duplicated in table T2 (same fields).

So far I have tried throwing together a query in the designer, and created a field there "[UniqueValue]:[F1] & [F2]". In the criteria I put "In (Select ([F1] & [F2]) AS [UniqueValue] From T2)". Have tried running this, but don't know whether it works. It has been running for half an hour or so, and I don't know how long it might take. I'll have to try it with a smaller number of records (currently millions in both tables), but any pointers would be appreciated.
Oct 22 '06 #1
4 2480
MMcCarthy
14,534 Recognized Expert Moderator MVP
SELECT F1, F2
FROM Table1 INNER JOIN Table2
ON (Table1.F1=Tabl e2.F1 AND Table1.F2=Table 2.F2);
Oct 22 '06 #2
Killer42
8,435 Recognized Expert Expert
SELECT F1, F2
FROM Table1 INNER JOIN Table2
ON (Table1.F1=Tabl e2.F1 AND Table1.F2=Table 2.F2);
Thanks, I'll give it a shot.
Oct 23 '06 #3
Killer42
8,435 Recognized Expert Expert
Thanks, I'll give it a shot.
I gave it a shot. :)

It worked like a dream, and I have now modified it to make a Delete query, which is what I had in mind.

Thanks heaps, mmccarthy.
Oct 23 '06 #4
Killer42
8,435 Recognized Expert Expert
P.S. I was always a bit vague on JOINs. Time to do some reading...
Oct 23 '06 #5

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

Similar topics

4
3627
by: Drew | last post by:
I have a permission tracking app that I am working on, and I have made the insert page for it. I am having issues on how to prevent duplicates from getting entered. Currently the interface for the app has a mixture of select boxes, list boxes and checkboxes. The form submits the page to processAIMR.asp and then does the inserting. I am using a loop to insert a new record for each checkbox checked or listbox entry selected. My...
1
3531
by: Smythe32 | last post by:
If anyone could help, I would appreciate it. I have a table as listed below. I need to check for duplicates by the OrderItem field and if there are duplicates, it then needs to keep the OrderItem with the highest interval and discard all other duplicates for that OrderItem number. If the OrderItem and the Interval are exactly the same, it just needs to keep one entry for the OrderItem.
3
4612
by: Tom Mitchell | last post by:
All: I'm stumped on a query. How do I find duplicates in a table where one of the duplicates has values is a certain field and the other doesn't. For example, I have the following table: tblItems ItemID ItemLabel
1
1675
by: MHenry | last post by:
Hi, I have a table with duplicate records. Some of the duplicates need to be eliminated from the table and some need not. A duplicate record does not need to be eliminated if the one record appears multiple times on one employee's report. However, if the same record(s) appear on any other employee's report, it means they collaborated on the item, and the item from the second employee's report should be eliminated from the table.
2
1887
by: Phil | last post by:
Hi. I have a table containing primary address, secondary address, road,town, postcode, there are otherfields within the table requestid, round, day, etc. I want to find all instances of the address if it occurs > 2 in a given period. I need a report that gives the address and other fields. I have tried using the find duplicates wizard, i need to run a query twice, once to pick up the primary address and street and postcode and one to...
7
4539
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent records. Should I design a new form for this or can I somehow make this work in the same form. Thanks in advance, john
3
5564
by: AccessHunter | last post by:
Please help with writing a VBA Code to find duplicates from the following acces table. Fields:- TranDate, Job Num, Agency Name Date is like this, 1/3/2003, 757702, People Office 1/3/2003, 762041, People Office 1/6/2003, 815643, Standard Services Inc 1/6/2003, 641502, Excellent Draft Solutions
3
2851
by: ryan.paquette | last post by:
In the table there are 2 fields in which I wish to limit (i.e. No Duplicates) Although I do not want to limit them to "No Duplicates" separately. I need them to be limited to "No Duplicates" as if they were one field. The 2 fields are "Employee_Name" & "Training_Course". *(There is another table for Employees & another for Training Courses, both of which are related to this table.)
4
6384
by: ryushinyama | last post by:
I had to do a lot of searching to get this one to work and in doing so I saw a lot of different sites where people were looking for this answer so I thought I would put it up. If you are trying to put data in to a table where you don't want any duplicate data a primary key, unique constraint and all that prevention is the best way to go. However when you try to insert data and it conflicts with an entry you get an error then you have to...
0
10099
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7451
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.