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.
4 2456 MMcCarthy 14,534
Recognized Expert Moderator MVP
SELECT F1, F2
FROM Table1 INNER JOIN Table2
ON (Table1.F1=Table2.F1 AND Table1.F2=Table2.F2);
SELECT F1, F2
FROM Table1 INNER JOIN Table2
ON (Table1.F1=Table2.F1 AND Table1.F2=Table2.F2);
Thanks, I'll give it a shot.
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.
P.S. I was always a bit vague on JOINs. Time to do some reading...
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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:
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |