From: Marc on 15 Mar 2010 16:17 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.
From: ghetto_banjo on 15 Mar 2010 16:40 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
From: KARL DEWEY on 15 Mar 2010 17:08 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.
|
Pages: 1 Prev: Query to find records after specific date and time today Next: multiple one to many |