Update Query using an imported table

  • Thread starter Thread starter h.a. collins
  • Start date Start date
H

h.a. collins

Hello Everyone,
I am attempting what I thought would be a simple update query between
two tables.

In table 1, I have added a new field called Email Address. This field
is currently blank.

Table 2 was originally a text file, which I imported into a new table.
It contains the same people as Table 1, as well as their email
address--which I would like to update to Table 1. However, table 2
does not have a primary key (or any unique identifiers for my people).
In the query design, I liked the two tables with the Email Address
field. Here is the SQL:

UPDATE Persons INNER JOIN Students ON Persons.[Email Address] =
Students.[Email Address] SET Persons.[Email Address] = Students.[Email
Address];

Any suggestions on what might be wrong here?

Humbly,
a newbie who should be asleep
 
H.A.

You can't use the email address as the basis of the join between the
tables. It won't work because one has got data and the other hasn't. A
Join between tables has to be on the basis of data in common, which
doesn't apply with the email. If the data in the person's name field(s)
is identical in the two tables, you would be able to use this as the
join field(s). Otherwise you are in strife (although I understand there
are some places where you can get manual data entry done reasonably
cheaply :-)
 
Steve,
Thanks for your help. I was in fact able to use the person's last name
as the join, and it worked for most of the records(now for the manual
tweaking..) Thanks again!
h.a.

Steve Schapel said:
H.A.

You can't use the email address as the basis of the join between the
tables. It won't work because one has got data and the other hasn't. A
Join between tables has to be on the basis of data in common, which
doesn't apply with the email. If the data in the person's name field(s)
is identical in the two tables, you would be able to use this as the
join field(s). Otherwise you are in strife (although I understand there
are some places where you can get manual data entry done reasonably
cheaply :-)

--
Steve Schapel, Microsoft Access MVP


h.a. collins said:
Hello Everyone,
I am attempting what I thought would be a simple update query between
two tables.

In table 1, I have added a new field called Email Address. This field
is currently blank.

Table 2 was originally a text file, which I imported into a new table.
It contains the same people as Table 1, as well as their email
address--which I would like to update to Table 1. However, table 2
does not have a primary key (or any unique identifiers for my people).
In the query design, I liked the two tables with the Email Address
field. Here is the SQL:

UPDATE Persons INNER JOIN Students ON Persons.[Email Address] =
Students.[Email Address] SET Persons.[Email Address] = Students.[Email
Address];

Any suggestions on what might be wrong here?

Humbly,
a newbie who should be asleep
 
Back
Top