Updating fields from one table to another

  • Thread starter Thread starter CAM
  • Start date Start date
C

CAM

Hello,

I have two tables one is call "ExcelIssues" and the second table call
"Issues" they both have the same fields.

Fields:
IssueNumber
Customer
LastModified

The field Customer and LastModified from the ExcelIssues table gets updated.
What I want to do is to update the Issues table from ExcelIssues based on
the IssueNumber updating the Customer and LastModified.

For Example: ExcelIssues table field Customer and LastModified has been
changed I want to reflect the change to the Issues table based on the
IssueNumber. How do I do that any tip or website to visit will be
appreciated. Thank you.
 
Sounds like an update query to me

UPDATE Issues INNER JOIN ExcelIssues
ON Issues.IssueNumber = ExcelIssues.IssueNumber
SET Issues.Customer = [ExcelIssues].[Customer]
, Issues.LastModified = [ExcelIssues].[LastModified]

You can add the following where clause if you wish to limit the number of
updates.
WHERE Issues.Customer <> [ExcelIssues].[Customer]
Or Issues.LastModified <> [ExcelIssues].[LastModified]
OR Issues.Customer is Null
OR Issues.LastModified is Null
OR ExcelIssues.Customer is Null
Or ExcelIssues.LastModified is Null

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Thanks John,

I appreciate the help.

Regards,


John Spencer said:
Sounds like an update query to me

UPDATE Issues INNER JOIN ExcelIssues
ON Issues.IssueNumber = ExcelIssues.IssueNumber
SET Issues.Customer = [ExcelIssues].[Customer]
, Issues.LastModified = [ExcelIssues].[LastModified]

You can add the following where clause if you wish to limit the number of
updates.
WHERE Issues.Customer <> [ExcelIssues].[Customer]
Or Issues.LastModified <> [ExcelIssues].[LastModified]
OR Issues.Customer is Null
OR Issues.LastModified is Null
OR ExcelIssues.Customer is Null
Or ExcelIssues.LastModified is Null

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

CAM said:
Hello,

I have two tables one is call "ExcelIssues" and the second table call
"Issues" they both have the same fields.

Fields:
IssueNumber
Customer
LastModified

The field Customer and LastModified from the ExcelIssues table gets
updated. What I want to do is to update the Issues table from ExcelIssues
based on the IssueNumber updating the Customer and LastModified.

For Example: ExcelIssues table field Customer and LastModified has been
changed I want to reflect the change to the Issues table based on the
IssueNumber. How do I do that any tip or website to visit will be
appreciated. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top