Copy data within one table to another

Number11

Member
Local time
Today, 05:58
Joined
Jan 29, 2020
Messages
624
So i have two tables I need to copy to the main table a date from another table I have the same customer ID in both tables the same i just need to add to table1
"Install-Date" from table 2 - i tried update query but it said needed an updatable query

just need

copy "Install-Date" from table 2 to table1 where the customer ID match ?
 
If you're adding a record, you'll need an INSERT statement rather than an UPDATE one.
 
So why can you not just look up that date in the first table?
 
When you have the same piece of data in multiple rows/tables, you have to be 100% on top of updating to ensure that ALL instances of the data get updated. This is poor practice and therefore discouraged. As Gasman suggested, a query that joins to the table that holds the data you need, is the correct solution. You might need to use a left join if the relationship is optional.
 

Users who are viewing this thread

Back
Top Bottom