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

INSERT data into Column A on Table1

Status
Not open for further replies.

Deenuts

IS-IT--Management
Oct 16, 2009
2
IE
I need to insert Department values(Column A) into Table1
where the userID on table1 = userID on table2 where the department values are stored.

How do I do an INSERT in Access? I have looked at the Update query and can't see how it might be used to this end.

Thanks in advance,
D
 
You need to provide a bit more information.

Does ColumnA already exist and you just want to put new values into it or are you adding new records to table1?

If you are just modifying values then an UPDATE statement is what you need.

If you are adding new records then INSERT INTO is the way to go.

I infer that you are updating rather than inserting so
Code:
UPDATE Table1 As T1 INNER JOIN Table2 As T2
       ON T1.UserID = T2.UserID

SET    T1.Department = T2.Department

Possibly you want "T1.ColumnA" in place of "T1.Department" since I'm not sure of your column names from your description.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top