5 Replies Latest reply on Aug 17, 2009 9:25 AM by philmodjunk

    Delete Duplicate Records

    Jubin

      Title

      Delete Duplicate Records

      Post

      Hi,

       

         Could anyone pls tell me how to Find and Delete Duplicate Records? Thanks in advance.

        • 1. Re: Delete Duplicate Records
          LaRetta_1
             Is this a one-time thing or an on-going process?
          • 2. Re: Delete Duplicate Records
            Jubin
               It's a one time thing.
            • 3. Re: Delete Duplicate Records
              dinora
                 Go to find mode and on the field that you want to find the duplicates type in "!"  This will find all duplicate records on the database by this field then you can go ahead and delete your duplicates as you choose
              • 4. Re: Delete Duplicate Records
                LaRetta_1
                  

                If the duplicates are based upon more than one field, you will need to create a calculation (result is text) which concatenates the fields together as:  Field1 & " " & Field2 etc

                 

                Then search for ! in the field (or this calc).  The following script will delete the SECOND of the duplicates (last one created). 

                 

                Enter Find Mode [ ]

                Set Field [ dups::field; "!" ]

                Perform Find [ ]

                Sort Records [ Specified Sort Order: dups::field; ascending ]

                [ Restore; No dialog ]

                Go to Record/Request/Page

                [ First ]

                Loop

                Omit Record

                Go to Record/Request/Page

                [ Next; Exit after last ]

                End Loop

                Delete All Records

                 

                BACK UP FIRST!!!!!

                • 5. Re: Delete Duplicate Records
                  philmodjunk
                     When deleting duplicate records, also be careful to avoid deleting related records that you may not want to delete. If you have another table of related records with the "Delete records in this table when a record is deleted in the other table" selected and your duplicate records have the same key value, then the related records also will be deleted. In this case, you may have to alter a key value so that it doesn't match any related records in before you delete it.