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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating one table from another

Status
Not open for further replies.

dporrelli

Programmer
Dec 18, 2002
43
GB
We were having a clear out of replicated data from a table and had users using a duplicate table. I'm now trying to run an update query that will update any changes made from the temp table into the original, but it does not update, and I get no errors.
Original table is called database, the temp one is called database1, there is only three fields I need to update, Next Contact, Account Manager and Contact History.
I have a auto-number primary key, so cut and paste didn't work, it only added them as new records.
 
If you don't have common unique keys between the two tables then there's no way to join them and determine that "this record in table A corresponds to that record in Table B".

You will need to find a field or combination of fields between the two tables that allow that record matching. This is one of the unfortunate possible side effects of using autonumbers as primary keys.

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
There is, the primary key is the same in both tables, table 2 was just a copy of table 1
 
so you took TABLE1 and made a copy of it, TABLE2. Then you added records to TABLE2 and deleted records from TABLE1 and now you want to put any new records in TABLE2 back into TABLE1. Right? Is there a date/time field so you can tell which records are "new" based on when the users started using the duplicate table?

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
It's OK guys, just figured it out, was my update query. THanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top