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

update columns between two tables

Status
Not open for further replies.

rony01

MIS
Sep 12, 2012
8
0
0
US


Hi
I have two tables with column A and column B. I want to update column B of table9 with column B of table1 .

table1
A | B
----|----
10 |12
14 |16

table9
A | B
----|----
1 |3
2 |4



I am trying this query in ms access from Vb.net. It pastes the column below the existing data


update table1 t1 LEFT JOIN table9 T9 on t1.a = t9.a SET t9.b = t1.b


table9
A | B
----|----
1 |3
2 |4
|12
|16

How do I write a update query that will replace the existing column like this?

table9
A | B
----|----
1 |12
2 |16

Thanks
 
Based on your example:

[pre]
table1
A | B
---|----
10 |12
14 |16

table9
A | B
--|----
1 | 3
2 | 4
[/pre]
and your outcome:

[pre]
table9
A | B
--|----
1 |12
2 |16
[/pre]

What is you logic that
table1.A with 10 = table9.A with 1 ? 10 = 1?
table1.A with 14 = table9.A with 2 ? 14 = 2?


Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top