hello friends
I have two tables with column A and column B. I want to update column B of table2 with column B of table1 . I have trying this query in ms access from Vb.net.

update table1 t1 LEFT JOIN table2 t2 on t1.a = t2.a SET t2.b = t1.b 

It pastes the column below the existing data. How do I write a query that will replace the existing column? Thanks

Recommended Answers

All 3 Replies

Try this:

UPDATE table1 t1 
    SET table2.b = t1.b
    WHERE t1.a = table2.a 

Let me know if this works or not.

Thank you so much , it worked

Or

UPDATE t2
SET t2.b=t1.b
FROM table1 t1 inner join table2 t2 on t1.a=t2.a
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.