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



 
 
Thread Tools Display Modes
  #1  
Old March 15th, 2010, 08:17 PM posted to microsoft.public.access.queries
marc
external usenet poster
 
Posts: 288
Default Update Query

I have two tables, Employee and Gaptable. In the employee table I have a SSN
field (social security number) a UPI field (unique personal Id numer) I want
to update the UPI field in the Gaptable where the SNN field matchs from both
tablle. How would I write the query for this? I hope it is clear enough.
  #2  
Old March 15th, 2010, 08:40 PM posted to microsoft.public.access.queries
ghetto_banjo
external usenet poster
 
Posts: 325
Default Update Query

if i am understanding you, it should be a basic Update query. Here is
the SQL:

UPDATE Employee INNER JOIN Gaptable ON Employee.SSN = Gaptable.SSN SET
Gaptable.UPI = Employee.UPI;



Note I assumed the field names were SSN and UPI in both tables. you
may need to modify accordingly...


Just a side note, it is often preferred to name your names to start
with "tbl", so they standout a little more in queries etc.

i.e. tblEmployee, tblGap, etc
  #3  
Old March 15th, 2010, 09:08 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Update Query


Backup databae Backup databae Backup databae

Try this --
UPDATE Employee, Gaptable SET Gaptable.UPI = [Employee].[UPI]
WHERE (((Gaptable.SSN)=[Employee].[SSN]));

--
Build a little, test a little.


"Marc" wrote:

I have two tables, Employee and Gaptable. In the employee table I have a SSN
field (social security number) a UPI field (unique personal Id numer) I want
to update the UPI field in the Gaptable where the SNN field matchs from both
tablle. How would I write the query for this? I hope it is clear enough.

 




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 08:05 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.