Update Query

M

Marc

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.
 
G

ghetto_banjo

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
 
K

KARL DEWEY

Backup databae Backup databae Backup databae

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top