Design Lookup Question

Novice1

Registered User.
Local time
Today, 11:11
Joined
Mar 9, 2004
Messages
385
In table#1 I have a field (SSN).

I want to match SSN, in table#1, with the same SSN in table#2, then extract the email (field) associated with SSN in table#2 and place in table#1.

Can you tell me or point me in the right direction? Thanks.
 
If you want to actually update table 1, I'd use an update query that joins to table 2. You should be able to start with a regular query that joins the tables and then switch it to an update query.
 
Your verbal description made me cringe because I think you have a design we tend to discourage. Let's start by saying that by definition, SSN is supposed to be unique. (There is the small matter that some folks don't have SSNs if they are recent immigrants and have not yet been granted an SSN.)

But to say that you have TWO tables with SSN and your description appears that the second table is 1-to-1 with the first table makes me wonder if you have studied the ideas of database normalization. While there are perfectly good reasons for a person to split a table into multiple 1-to-1 parts, none of them are likely situations for someone who is a novice. I suggest that you may have an inefficient table design which leads to the problem that you are having.
 
I hear you; however, table 2 isn't a permanent data set. It's a linked table that changes every week. It's more or less a look-up table, which transfers data into the table I'm working. Thanks
 
Let me try this a different way.

I have a table (I get from another data source as an Excel spreadsheet). The spreadsheet lists all our customers (SSN, Name, Email, Office, and Supervisor SSN). Before I import the data into our database, I would like to replace the Supervisor SSN with the supervisor's Email). Because the supervisors are also our customers they are listed on the same spreadsheet.

How would I go about this task?
 

Users who are viewing this thread

Back
Top Bottom