Results 1 to 6 of 6
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Insert rows (2002)

    How do I copy all the rows from table 2 into table 1 leaving off all duplicate rows? Can I do this in the Access UI with some wizard or do in need to write an Insert query?

    In other words, how do I merge two tables? (The columns are identical)
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Insert rows (2002)

    Ah! found it. Click around long enough and you're bound to find something that works. Here's how:

    1) Open Project File. Click Tables.
    2) Right click table to copy, click Copy
    3) Right click white space, click Paste
    4) In "Paste Table As" dialog, click "Append Data..." and type the destination table name.
    5) Click Ok.
    6) At the nasty looking "warning" dialog, click Yes to proceed. (You'll only see this warning if you have duplicate records and a primary key set on the destination table.)
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Insert rows (2002)

    Whoops. That don't work. Missing records. Not sure why... Something to do with those duplicates...
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Insert rows (2002)

    Missing records? That isn't very specific. Was there an autonumber column involved perchance?
    Charlotte

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Insert rows (2002)

    When the append finished, the destination table did not contain a "merge" of all records from table1 and table2. Some records were appended, most were not.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Insert rows (2002)

    Um, you didn't ask for a merge of all the records. I thought you were appending from table2 to table1 or vice versa. And is there an autonumber in there? If there is and you tried to append it, the value would have also been appended. If it already existed in the destination table, it wouldn't be appended again. Or are we again dealing with an ADP and SQL tables, which are different from Access tables in many ways.
    Charlotte

Posting Permissions

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