Re: No duplicates
- From: "Jason Lepack" <jlepack@xxxxxxxxx>
- Date: 18 Jan 2007 13:21:17 -0800
You need what is called an Outer Join (Left or Right). Join the two
tables based on the field "Colour" and you will get an "Inner Join".
Now double click on the join and you will be shown the Join Properties
screen. Choose "Include all records from the table with the most
colours and only those from the table with the least colours where they
are equal" (or something like that). Then you want to add the Colour
field from each of the two tables, but for criteria for the table with
the least colours you want to put "Is Null"
(Boy, it sounds convoluted to do it that way)
Or if you know how to input SQL you can use this:
SELECT Table1.colour
FROM Table1 LEFT JOIN Table2 ON Table1.colour = Table2.colour
WHERE Table2.colour Is Null;
Table1:
colour - Text - Primary Key
Table1 Values:
Red
Yellow
Blue
Green
Orange
Table2:
colour - Text - Primary Key
Table2 Values:
Red
Green
Orange
Query1:
SELECT Table1.colour
FROM Table1 LEFT JOIN Table2 ON Table1.colour = Table2.colour
WHERE Table2.colour Is Null;
Query1 Results:
Blue
Yellow
Cheers,
Jason Lepack
ladybug via AccessMonster.com wrote:
I know that I should know this, but I am having a complete dumb moment.
Here is a simple example.
I have two tables. 1st table has red, blue, green, yellow, orange
2nd table has red, green, orange
I want to do a query that returns blue and yellow
I want to know out of the first table what is not in the second table.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200701/1
.
- References:
- No duplicates
- From: ladybug via AccessMonster.com
- No duplicates
- Prev by Date: RE: Create Object Error - 29054
- Next by Date: RE: File Picker Dialog
- Previous by thread: No duplicates
- Next by thread: Re: No duplicates
- Index(es):
Relevant Pages
|