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

Simple Update query

Status
Not open for further replies.

thechrisproject

Programmer
Jan 29, 2004
1
US
I'm just trying to do a simple update query. I have two tables, one called Entries and the other called EntryUnits. Right now, both of them have a datetime column called dateAdded. Entries' primary key is entry_id. EntryUnits has a column entry_id that references the Entry.

Okay, so I want to update all the dateAdded columns in Entries with the dates from the corresponding columns in EntryUnits.

This is the query I wrote:

update Entries,EntryUnits set Entries.dateAdded=EntryUnits.dateAdded where Entries.entry_id=EntryUnits.entry_id


This results in ERROR 1064: You have an error in your SQL syntax...

What am I doing wrong here?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top