combining tables

J

jlute

I need to normalize by moving a field from one table to another. How
can I update the field after I move it? For example, I'm moving
[Field1] from tblOld to tblNew. Both of these tables have the primary
key [ID] and contain records.

Thanks for your help!
 
M

Michel Walsh

UPDATE tblNew INNER JOIN tblOld ON tblNew.id = tlbOld.id
SET tblNew.field1= tblOld.field1



as example. I assumed tblNew.id = tblOld.id indicates the relation which
allows to find the tblOld.field1 value which will be used to update
tblNew.field1, given tblNew.id



Vanderghast, Access MVP
 
J

jlute

Thanks, Michel! Your assumptions were correct. You make everything
look easy! I just couldn't figure it out. In any case here's my actual
info (I always try to simplify my questions with dummy names, etc.).

UPDATE tblProfiles INNER JOIN tblFGAttributes ON
tblProfiles.txtProfileID = tblFGAttributes.txtProfileID
SET tblProfiles.Status = tblFGAttributes.Status

UPDATE tblNew INNER JOIN tblOld ON tblNew.id = tlbOld.id
SET tblNew.field1= tblOld.field1

as example. I assumed tblNew.id = tblOld.id indicates the relation which
allows to find the tblOld.field1 value which will be used to update
tblNew.field1, given tblNew.id

Vanderghast, Access MVP




I need to normalize by moving a field from one table to another. How
can I update the field after I move it? For example, I'm moving
[Field1] from tblOld to tblNew. Both of these tables have the primary
key [ID] and contain records.
Thanks for your help!- Hide quoted text -

- Show quoted text -
 
D

Dale Fye

Are you normallizing, or just splitting the table into multiple one-to-one
tables?

If you were truly normalizing, I would think your second table would not
have the ID field from the first table, because the point of normalizing is
getting rid of extraneous data.
 
J

jlute

Hi, Dale.

Truly normalizing. I'm moving [Status] from tblFGAttributes to
tblProfiles so that I can eliminate tblFGAttributes which served the
purpose of being a "junction" table. No need for it now that I've
radically normalized the entire structure.

Are you normallizing, or just splitting the table into multiple one-to-one
tables?

If you were truly normalizing, I would think your second table would not
have the ID field from the first table, because the point of normalizing is
getting rid of extraneous data.

--
Dale

email address is invalid
Please reply to newsgroup only.



I need to normalize by moving a field from one table to another. How
can I update the field after I move it? For example, I'm moving
[Field1] from tblOld to tblNew. Both of these tables have the primary
key [ID] and contain records.
Thanks for your help!- Hide quoted text -

- Show quoted text -
 

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