?
Solved

Eliminating records from filea that match fileb - Access 2007

Posted on 2011-02-18
4
Medium Priority
?
262 Views
Last Modified: 2012-08-13
I have two tables that I can match by ID.  If the ID on table A is found on Table B, I do not want to include the record on Table C.  If there is no match that I would like to include the record on Table C.
How can I do this is Access?  
0
Comment
Question by:morinia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Expert Comment

by:geowrian
ID: 34931425
Did you try this?

INSERT INTO TableC(field1, field2, etc)
SELECT field1, field2, etc FROM Table1
LEFT OUTER JOIN Table2
ON Table1.ID=Table2.ID
WHERE Table2.ID IS NULL

Open in new window

0
 
LVL 10

Accepted Solution

by:
Michael Vasilevsky earned 2000 total points
ID: 34931426
SELECT * FROM TableA WHERE TableA.ID NOT IN (SELECT ID FROM TableB)
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34931429
does tablec already exists?

if it is, using an append query

insert into tablec
select tablea.* from tableA  as A
left join tableB as B On A.ID=B.ID
where B.ID is null
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34931436
if tableC does not exists, use a make table query

select A.* into tableC
from tableA as A
left join tableB as B On A.ID=B.ID
where B.ID is null
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question