Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Red face Unanswered: Still Needing Help With Compare Tables Task

    Please, if anyone can help, I appreciate it. I still have two tables, each with columns in common and ones not in common, and I have a macro group to import the 2nd table from its original source within another database, and now I am at the task of running a query or writing code for comparison...not sure what I should do, but I need to compare the first and second tables and update the first tabel with new and edited info within the common coumns in the 2nd table. Then I need to actually update the first table - if I use an automated query for this, do I need a relationship btwn tables, and if so, can I automate the relationship-getting, b/c this whole string of events is to be automated. I also don't know how to connect two or more macro groups, so that they run one after another until all run through. Any leads would be appreciated - I'm so new at this, I'm really at a loss.
    Thanks,
    CaRa
    CaRa

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    Have a look at unmatched and duplicate query wizards.

  3. #3
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Thumbs up

    yes, this is what I am doing at the mment, actually - and it works in terms of new rows of data...I made an 'unmatched' query for 4 columns - because she could change any data in column rows already in existence in her table (which I imported...blah blah) - so when I run a unmatched query for the 2nd column, I don't get any results, because there are no new values, just changed values, and it wants to find values where in one table the values are null. Any suggestions as to what other type of expression I can give it to basically say "i want to include all values from title 3 column so long as they don't match the values in the same column of the other table in the query"?

    BTW< I appreciate your response :O)
    CaRa

  4. #4
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22

    Post

    to what I said above, this is assuming I run the first query which looks for differences in the first column, and if there are, chances are if the column is null in one table, it doesn't exist there yet, so I can append it then, with an append query...now I want to do the same first type of query for the 2nd column and then use an update query, though that seems to want me to enter a specific update value, which I won't have, per say, since this will all be automated - and if I append, I think it will want to add to the bottom of the list...this whole thing seems overly complex for what I need to do - I am amazed Microsoft does not have a press-button function for table comparison...oh well :O(
    CaRa

  5. #5
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173
    Would it be safe for me to assume that both tables have the same unique number/id/PK identifying each record. ie if it is uniqueid 1 in the first table, then you are looking for uniqueid 1 in the second table....

    Originally posted by caraev11
    to what I said above, this is assuming I run the first query which looks for differences in the first column, and if there are, chances are if the column is null in one table, it doesn't exist there yet, so I can append it then, with an append query...now I want to do the same first type of query for the 2nd column and then use an update query, though that seems to want me to enter a specific update value, which I won't have, per say, since this will all be automated - and if I append, I think it will want to add to the bottom of the list...this whole thing seems overly complex for what I need to do - I am amazed Microsoft does not have a press-button function for table comparison...oh well :O(
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  6. #6
    Join Date
    Dec 2002
    Location
    CT
    Posts
    22
    yes, the primary key is the same for both tables, I think - at least in my simulated database (I haven't touched the real one yet, until I know what I'm doing will work) - the names for the columns in common will be the same - the thing is that running the query to find differences turns up the differences, but when I try to build another quesry to append or update, it seems that appending only adds to the bottom of the list, and the updating query turns up errors, because it wants specific values to update to - so I'm a little stuck as to how to update using this method.
    CaRa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •