Select from two tables

Cliff

Registered User.
Local time
Today, 10:14
Joined
Dec 2, 2008
Messages
18
I want to create what I thought was a simple select query.

I have 2 tables.
COMPONENTS
UNIT_ID
COLL_DATE

ATTRIBUTES
ATTRIB_CODE
UNIT_ID

The COMPONENTS table lists each item only once, the ATTRIBUTES will have anywhere from no ATTRIB_CODE values to several.

Here's and example:
Code:
COMPONENTS
123   1/2/2011
456   3/5/2011
789   2/1/2011

Code:
ATTRIBUTES
123   abc
123   def
123   ghi
456   abc
456   ghi

What I want to select are all UNIT_ID between 1/1/2011 and 3/28/2011 that do not have the ATTRIB_CODE of def. So if a UNIT_ID is listed in the ATTRIBUTES table multiple times, I do not want it on the list if it has that attribute. In this example I want a list that inlcudes 456 and 789.

Thanks
 
Take a look at the unmatched query Wizard.
 
Thanks, but I'm not sure that is what I want.
I want all UNIT_ID from the COMPONENTS table unless there is an ATTRIB_CODE of "X" in the ATTRIBUTES table.
 

Users who are viewing this thread

Back
Top Bottom