If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Update query help
I'm trying to update all records in one table GCI.EmployeeName to House after
I add a check to y/n field in table2 EmployeeInfo UPDATE GCI.EmployeeName to house WHERE EmployeeInfo.EmployeeName, EmployeeInfo.Terminated = 'y'; Thanks in Advance for any help -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200907/1 |
#2
|
|||
|
|||
Update query help
jenksonu via AccessMonster.com wrote:
I'm trying to update all records in one table GCI.EmployeeName to House after I add a check to y/n field in table2 EmployeeInfo UPDATE GCI.EmployeeName to house WHERE EmployeeInfo.EmployeeName, EmployeeInfo.Terminated = 'y'; Thanks in Advance for any help -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The syntax is incorrect. Try something like this: UPDATE GCI INNER JOIN EmployeeInfo On GCI.EmployeeID = EmployeeInfo.EmployeeID SET GCI.EmployeeName = 'House' WHERE EmployeeInfo.Terminated = True Hopefully, there's an EmployeeID in both tables. Standard SQL: UPDATE GCI SET EmployeeName = 'House' WHERE EmployeeID IN (SELECT EmployeeID FROM EmployeeInfo WHERE Terminated = True) HTH, -- MGFoster:::mgf00 at earthlink decimal-point net Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails ** -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBSlcMp4echKqOuFEgEQIARwCgsHBlIIX2/wIV76t/P+tIEnm2PawAnizO w0cO3+/w384nDxvXChuN805P =txyT -----END PGP SIGNATURE----- |
Thread Tools | |
Display Modes | |
|
|