Thank you in advance for your help! I have two Excel spreadsheets that I
successfully imported into Access 2003 and created tables for. I need to add
the field from one table to the other, but there is not a direct match in the
relationship. The large table uses the Employee ID as the primary key. The
smaller table contains one field that lists a subset of these Employee ID
numbers (a selection of certain employees). I need to transfer this field to
the larger table, but I do not know how to tell Access to match up the
corresponding numbers (i.e., the large table lists all employees, but the
added field will only match up with those employees who appear in it.) In
addition, I need to change the value of the data in the added field from its
original number form to a "yes." Therefore, the "yes" would appear in the
added field in the record that corresponds with the appropriate Employee.
Any help would be greatly appreciated. I'm fairly new at this program and
feel that there has to be an easier way to do this than just adding a field
and hand keying all of the "yes" entries with the corresponding numbers.
THANK YOU!
Ken Sheridan - 12 Jan 2008 23:45 GMT
Add a Boolean (Yes/No) field to the larger table and create an update query
which joins the two tables on the Employee ID fields, updating the Boolean
field to True. Because an INNER JOIN, which is the default join type in the
query designer, only returns rows where there is a match, only those rows in
the larger table where there is a matching row in the smaller table will be
updated. In SQL the query would look something like this:
UPDATE [LargerTable] INNER JOIN [SmallerTable]
ON [LargerTable].[Employee ID] = [SmallerTable].[Employee ID]
SET [LargerTable].[YourBooleanField] = TRUE;
Ken Sheridan
Stafford, England
> Thank you in advance for your help! I have two Excel spreadsheets that I
> successfully imported into Access 2003 and created tables for. I need to add
[quoted text clipped - 12 lines]
> and hand keying all of the "yes" entries with the corresponding numbers.
> THANK YOU!