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 Chriss Miller 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.

countdrak

Programmer
Jun 20, 2003
358
US
Code:
UPDATE Training inner join test
on Training.uid = test.uid 
AND Training.EventID = test.EventID
SET Training.StartDate = test.StartDate

Whats wrong with this simple update query!
Incorrect syntax near the keyword 'inner', thats the error I keep getting. *Frustrated* Am I not seeing something? Thanks. Using MS SQL Server 2000
 
have you tried
Code:
UPDATE Training set training.startdate = test.startdate 
Inner Join Test on training.uid = test.eventid

Not sure, but perhaps you have to have the set part first
 
Nah thats not the problem I keep getting the same error.! Thanks though.
 
You're using SQL Server and this is the MS/Access SQL forum. From an Access perspective the statement looks OK but there may be a reserved words issue with SQL Server. Try something like
Code:
UPDATE [Training] inner join [test]
on [Training].uid = [test].uid 
AND [Training].EventID = [test].EventID
SET [Training].StartDate = [test].StartDate
You might try posting in Forum183.
 
Another way:
UPDATE Training
SET StartDate = (SELECT StartDate FROM test
WHERE test.uid = Training.uid AND test.EventID = Training.EventID)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top