|
-
Apr 5th, 2006, 06:28 PM
#1
Thread Starter
Hyperactive Member
Finding the excluded records in access
If I have
tblOne with column [Social]
with value 1,2,3,4,5,6,7,8,9,10
and...
tblTwo with column [social]
with value 1,2,3,4,9,10,11,12,13,14
How can I make a querie so that it looks at the two tables and returns the fields in tblOne that are not represented in tblTwo.
giving me the results 5,6,7,8
Many thanks to anyone who can help me get over this hurdle. ~Bryan
-
Apr 6th, 2006, 12:12 AM
#2
Re: Finding the excluded records in access
Hi,
Just use the concept of subquery....Here is the equivalent SQL Statement to retrieve your desired results..This sql statement works fine..Attach this in your query design view...Let me know...
Select Social from tblOne where Social not in (Select Social from tblTwo);
Greg
-
Apr 6th, 2006, 08:44 AM
#3
Re: Finding the excluded records in access
OR you can use an OUTER JOIN statement and look for NULL values in the 2nd table.
Code:
SELECT T1.social
FROM tblOne T1
LEFT OUTER JOIN
tblTwo T2
ON T1.social = T2.social
WHERE T2.social IS NULL
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|