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

How do I update records from from table1 to table2. 1

Status
Not open for further replies.

serino

Programmer
Feb 13, 2003
112
US
I have two tables called MAIN and SUBMAIN. They both contain the same fields. Job#, StartDate and Enddate. I would like to update the SUBMAIN table from the MAIN table.

This is what I have so far but I receive a syntax error.

[blue]
UPDATE Submain INNER JOIN Main ON Submain.job# = Main.job#;[/blue]
 
An UPDATE statement needs a SET clause:
UPDATE Submain INNER JOIN Main ON Submain.[job#] = Main.[job#]
SET Submain.StartDate = Main.StartDate, Submain.Enddate = Main.Enddate

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you PHV. You learn something everyday... Thanks again have a Star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top