NAB + NCD -> NABCD

V

vjp2.at

If I have one table with fields N, A ,B
and another table with fields N, C, D
and I want to put the data from the second into the first to produce
N,A,B,C,D

How may this be done (alter table left join??)??


- = -
Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist
http://www.panix.com/~vjp2/vasos.htm
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Homeland Security means private firearms not lazy obstructive guards]
[Urb sprawl confounds terror] [Phooey on GUI: Windows for subprime Bimbos]
 
B

Bob Barrows

If I have one table with fields N, A ,B
and another table with fields N, C, D
and I want to put the data from the second into the first to produce
N,A,B,C,D

How may this be done (alter table left join??)??
With an update query.
 
J

John W. Vinson

If I have one table with fields N, A ,B
and another table with fields N, C, D
and I want to put the data from the second into the first to produce
N,A,B,C,D

How may this be done (alter table left join??)??

First off... do you need to? Why store the same data redundantly in two
tables? If you just need to see the data together, a simple Query should do
so.

Secondly, is N the Primary Key, or otherwise a unique Index? If not, how can
you identify which A goes with which C?

If you really have good reason to do this, it's simplest to do it in two
steps. Open the first table in design view and add two new fields, C and D,
using the same datatype and size as in the second table. Then (if N is indeed
unique) create a Query joining the two tables by N; change it to an Update
table; and update Table1.C to

=[Table2].[C]

and the same for D. Run the update query and you're done.

Use the actual tablenames and fieldnames of course, and you MUST use the
[square brackets], or it will update all records in Table1 to the literal text
string

"Table2.C"

--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top