Advertisement

07.17.2008 at 05:48PM PDT, ID: 23575452
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

SQL UPDATE w/ JOIN to external DB?

Asked by PumpMeister in SQL Query Syntax, Access Coding/Macros

Tags: , ,

I need to implement a rudimentary change tracking scheme for three tables in a database that is backed up daily.  Normally, I would track changes via a data entry form, but in this database some of the data is put into the tables by a 3rd party add-in to AutoCAD.  Thus, some of the data entry is outside my control and ability to track it.

Because of this, I am planning to implement a change tracking scheme by comparing the data in todays database tables to those in yesterday's back up.  Records that are detected to be changed from yesterday will be marked by putting today's date in a Rev_Date field.

I am looking at how to do this, and trying to work up the automatic generation of SQL code to do the comparison and marking quickly.   Since the fields in the three tables of interest may change in the future, I want to generate the appropriate SQL statement on the fly so that I don't have to keep updating it.  (I have done that type of thing before.)

There is a key field called IDCOUNT that I can use to join today's copy of the tables to yesterdays copy.

Where I am stumbling on this is in determining whether I can do the UPDATE statement with a reference to a table in an external db (yesterdays db copy, in this case).  

It looks like I need to generate the UPDATE statement such that it does a join between today's table copy and yesterdays based on IDCOUNT.  The SET clause is easy since I am only setting one field, Rev_Date.  The WHERE clause will be a pain... I will need to create a list of comparisons between a lot of fields in different tables having the same names.

MY QUESTION:
I don't see anywhere where it is possible to reference a table in an external DB in an UPDATE statement.  Is this possible?

If not, then I assume I should create a SELECT query on the fly to generate the relevant set of IDCOUNTS, then use that result set to feed the UPDATE query (subquery approach).  Correct?

I will be happy to answer any clarifying questions before awarding points.

Thanks!

SteveStart Free Trial
 
Loading Advertisement...
 
[+][-]07.17.2008 at 10:09PM PDT, ID: 22033014

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 11:27PM PDT, ID: 22033230

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 12:02AM PDT, ID: 22033353

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 12:44AM PDT, ID: 22033541

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 12:54AM PDT, ID: 22033592

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 02:50AM PDT, ID: 22034134

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Access Coding/Macros
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.18.2008 at 04:20AM PDT, ID: 22034524

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:25AM PDT, ID: 22034553

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 04:55AM PDT, ID: 22034703

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:00AM PDT, ID: 22034729

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628