Results 1 to 2 of 2
  1. #1
    jhargram is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    40

    Move duplicate values in a different table....

    HI All,

    I have two tables with same column name in my ms access database. In one table i have some data with some duplicate values. I want to move only that duplicate values to another table.. exmp:

    Table a Table b

    column 1:name column 1:name
    column 2:address column 2:address


    Table "a" Data:
    name address
    x xxx
    y yyy
    x xxx
    z zzz


    need one query to insert the duplicate row to another table.
    After query run. It should be like:

    Table a:



    name address
    x xxx
    y yyy
    z zzz

    and Table b

    name address
    x xxx

    Please help me to write this query or give me the solution.

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Just check if below gives some guidelines :
    Let us say, you have TableA
    name address
    x xxx
    y yyy
    z zzz
    x xxx

    Chech below make table queries :
    qryMakeTableAA
    Code:
    SELECT DISTINCT 
        TableA.name, 
        TableA.address 
    INTO 
        TablAA
    FROM 
        TableA;
    and

    qryMakeTableBB
    Code:
    SELECT 
        TableA.name, 
        TableA.address, 
        Count(TableA.address) AS CountOfaddress 
    INTO 
        TableBB
    FROM 
        TableA
    GROUP BY 
        TableA.name, 
        TableA.address
    HAVING 
        (((Count(TableA.address))>1));
    Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. move to different field when duplicate
    By Fabdav in forum Queries
    Replies: 1
    Last Post: 10-16-2011, 04:19 PM
  2. duplicate values
    By tarhim47 in forum Access
    Replies: 7
    Last Post: 05-03-2011, 11:30 AM
  3. Duplicate field(s) and move to new record
    By cwatson62 in forum Queries
    Replies: 0
    Last Post: 04-05-2011, 10:31 AM
  4. Defaults Values Missing After DB Move
    By cbuechler in forum Database Design
    Replies: 2
    Last Post: 02-15-2011, 08:33 AM
  5. Duplicate Values in table
    By senthilrg in forum Queries
    Replies: 3
    Last Post: 12-18-2009, 09:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums