A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update query help



 
 
Thread Tools Display Modes
  #1  
Old July 10th, 2009, 05:41 AM posted to microsoft.public.access.queries
jenksonu via AccessMonster.com
external usenet poster
 
Posts: 10
Default 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  
Old July 10th, 2009, 10:41 AM posted to microsoft.public.access.queries
MGFoster
external usenet poster
 
Posts: 653
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.