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!

Update SQL statement returns error.

Status
Not open for further replies.

egodette

Technical User
Jun 12, 2002
222
US
I can't get this update statement to work. The error message states that "Operation must use an updateable query". Here is my statment.

update trades set accountname=(select field2 from xyz,trades where xyz.field1=trades.portcode)

The subquery when run alone returns the correct information. I want to take the information from xyz table and put it into trades table for the corresponding name information.
 
I found the answer.. thanks..

Update table2
Inner Join table1
On table2.keycol = table1.keycol
Set col1 = table1.col5,
col4 = table1.col6,
col8 = table1.col2
 
The old style WHERE clause joins frequently (maybe always, I'm not sure) return a Read Only recordset. A little tip, create a query and then look at the SQL it generates to learn how to use INNER JOIN / ON syntax.

Nice job on figuring it out for yourself! Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need![thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top