Results 1 to 3 of 3
  1. #1
    chadd is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    2

    Delete Duplicate Records Based on Criteria

    I have a log/table that contains the results of a program we use to clean hard drives. I will call this WipeTable. I cross-reference this table with another table that contains all of the units processed each day. I will call the second table UnitTable. Ultimately, I check to ensure that all of the records in UnitTable indicated as "wiped," have a corresponding record of success in the WipeTable. The WipeTable contains multiple duplicates. For various reasons, the wiping of a unit may be initiated multiple times, which means that Hard Serial Numbers are repeated I would like to remove the duplicates from WipeTable before I cross-reference against the UnitTable. Identifying the duplicates is easy. What I would like to know is how I can automatically delete certain records based on criteria described below.



    Identify duplicate hard drive serial numbers
    Of the duplicates, delete the records that have a "0" in the success field if another record contains a "1" in that field.
    If none of the duplicate records have a "1" in the success field, delete all except one record with "0"

    WipeTable
    Hard Drive Serial Number (alphanumeric)
    Success of Wipe (1 = success, 0 = not a sucess)

    UnitTable
    Hard Drive Serial Number
    Wipe Status

    Any ideas?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    chadd is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    2
    Thank you June 7. I have been away for the last day or two and unable to attempt the solutions outlined in the article. Thank you for passing them along. At the minimum they will help me by providing a foundation that I will hopefully be able to tweak to suit my needs.

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

Similar Threads

  1. Replies: 5
    Last Post: 01-24-2012, 06:19 PM
  2. Replies: 3
    Last Post: 05-03-2011, 01:36 PM
  3. Replies: 1
    Last Post: 05-21-2010, 02:22 PM
  4. Replies: 0
    Last Post: 04-08-2010, 12:22 PM
  5. Delete duplicate records
    By Zukster in forum Queries
    Replies: 1
    Last Post: 08-26-2009, 03:14 AM

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