473,503 Members | 5,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

finding info in a master table

Hi all

I've not used Access 2k for a few years and can't remember how to get
information from one table that is not in several other tables.

I have 4 Tables in my DB

tbl 1 - TblMaster - 220k rows <<< note size
tbl 2 - tblA - 10k rows
tbl 3 - tblB - 8k rows
tbl 4 - tblC - 3k rows

The master table has a column with an ID number - I was told this is
unique but have found dupicate numbers. (its not an auto number)

Tables A, B, C, contain information (different from the Master table)
except for one field. the "unique" id number

I need to create a table D from table MASTER - that contains all the
records/rows that are *NOT* in tables A, B, C

I have looked at something like this:

SELECT tblmaster.* (i'll put field names here), INTO tblD
FROM
tblMaster
WHERE tblMaster.id NOT IN (SELECT id FROM tblA)
AND tblMaster.id NOT IN (SELECT id FROM tblB)
AND tblMaster.id NOT IN (SELECT id FROM tblC);
Is this the correct/best way to pull out all the rows from master tbl
that are not in A, B, C and store that info into tblD ???

Any other way that might be better. I did the above and it was still
working after 20 mins (had to leave work so stopped it)

Thanks for any help.

Alan

Nov 13 '05 #1
1 1846
If possible, use outer joins instead of NOT IN.

SELECT A.fld1, A.fld2, B.fld1,B.fld2
FROM A LEFT JOIN B ON A.fld1=B.fld2
WHERE B.fld2 IS NULL;

Then just do a bunch of left joins (A to B, A to C...)
This will return a group of records. Once you get this right, turn the
query into an Append Query and add the records to a new table. (and
you might want to outer join to that to eliminate all the records that
are already in the destination table).

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
27835
by: M Bourgon | last post by:
I'm trying to figure out how to find the last whitespace character in a varchar string. To complicate things, it's not just spaces that I'm looking for, but certain ascii characters (otherwise,...
2
1543
by: Chris Belcher | last post by:
While I'm sure this is simple I just can't figure it out. Table A (assignments) is on the One side of a One to Many relationship With Table B (assignees)There are many assignees assigned the one...
1
2346
by: feck | last post by:
I have a database with several tables, one of which is I use this to bring up a form so you can unlock the record (set by using a yes no box on the data input form to prevent unauthorised...
1
1562
by: Mr. B | last post by:
VB.net 2003 c/w Framework 1.1 and MS Access db We have a commercial program that does our Acounting and Time Sheets (Timberline). At least once a day our Accounting department runs a Script...
1
3395
by: rdemyan via AccessMonster.com | last post by:
I'm trying to implement a licensing scheme. There are three types of licenses: Trial - good for 30 to 60 days Interim - good for 1 year Fully Paid - no expiration Everything is working fine...
2
1988
by: Extremest | last post by:
Here is the code I have so far. It connects to a db and grabs headers. It then sorts them into groups and then puts all the complete ones into another table. Problem I am having is that for some...
4
4192
by: jrett | last post by:
I'm new to ASP.NET and fairly inexperienced with web development in general, but I've been a professional software dev for over 10 years, C++, Unix and windows, C# the past 4 years. I've been...
2
1012
by: goldfish999 | last post by:
I am new to Visual Basic (have not used since version 1 !!) but am trying to learn a new language (have had experience with Delphi ). I have an existing database created in VB 2005 of a Master Table...
1
1994
by: Rosy | last post by:
I have a form "A" that is set on table vessel names. I have subform "B" that is set on table vessel info. I want form "B" to update based on what vessel I choose in form "A". I know this is...
0
7063
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
7313
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...
1
6970
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
5558
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,...
1
4987
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...
0
3156
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...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
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 ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.