Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append only new records 1

Status
Not open for further replies.

GDJP

Technical User
Oct 16, 2001
9
CA
I am relativly new to Access and am strugling with this issue. I have two tables both are idetically structured. They both share some records but not all. I want to append one table (PARA01) to the other (PARA00) but only those records which do not already exist in PARA00.

I think this is simply a criteria issue in the append query I am using but I can not seem to find the correct xpression to achive this can anyone help?

Thanks in advance

Grant
 
Grant,
2 ways. First, if the primary keys are the same (as in NOT autonumber), just force the whole second table into the first and accept the 'not all records could be appended' error.
If the keys *are* different, ie there's an autonumber as key, but some other field or fields are truly the 'key', use for criteria:
Insert into table2 select * from table1 Where Table1.SomeKey Not In(select table2.SomeKey from table2)
You'd not use the *, though, since if you have autonumber you can't append that into the other tables autonumber.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top