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