Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / December 2004

Tip: Looking for answers? Try searching our database.

querying 2 tables to exclude non-matching records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jimsolt - 31 Dec 2004 04:19 GMT
I have 2 tables. One listing residents of a community, the other listing
members of a club.  How can I arrive at a list of community members who are
not members of the club?
Thanks.
Steve Huff - 31 Dec 2004 05:12 GMT
Ok you'd create a query with both tables and then join them by the Primary
Key like member ID then you'd double click on the join line and select the
statment that said something like:

"Include ALL records from tblClub and only those records from tblCommunity
where the joined fields are equal."

Then you'd bring down all the fields that are relevent to tblCommunity to
the field listing and you'd bring down the MemberID from tblClub and add the
Criteria "Is Null"

Here is an example of what the resulting SQL would be:

SELECT tblClub.FName, tblClub.LName
FROM tblClub LEFT JOIN tblCommunity ON tblClub.MemberID =
tblCommunity.MemberID
WHERE tblCommunity.MemberID Is Null;

Hope that helps...
Signature

_______________________
Steve Huff
http://www.huffs.us
Generic email: null@huffs.us

>I have 2 tables. One listing residents of a community, the other listing
> members of a club.  How can I arrive at a list of community members who
> are
> not members of the club?
> Thanks.
John Vinson - 31 Dec 2004 06:56 GMT
>I have 2 tables. One listing residents of a community, the other listing
>members of a club.  How can I arrive at a list of community members who are
>not members of the club?
>Thanks.

There is an "Unmatched Query Wizard" which will do just this; create a
new query and select that wizard.

                 John W. Vinson[MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.