Results 1 to 4 of 4
  1. #1
    scheibla is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    2

    Question Access 2010 Delete Query Question

    I have an access database where I am trying to use a query to remove duplicates from a table. My Fields are: MRN, APPT MADE DATE, Division, and User in the table Failed Complex Scheduling.



    I have selected the delete query to use, but I am unsure what my criteria should be for this situation. I need MRN and APPT MADE DATE to be duplicated in one or more rows. However, in those rows Division and User cannot be duplicated.

    I started by doing a duplicate query so that all of my MRN and APPT MADE DATEs are narrowed down to just duplicates, now I am unsure how to get rid of duplicates in the Division and User fields.

    I have been Googling and playing around with this for hours to no avail. I am fairly new at Access, VBA, and SQL (gotta start somewhere!). If anyone could lend a hand - it would really be appreciated.

    Edited for more info: Adding Distinct after Select in SQL has not worked. Also, going to Property Sheet and changing Unique Values (and Unique Records) to yes did not work either.
    Last edited by scheibla; 05-01-2012 at 07:56 PM.

  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,929
    So all 4 fields must be considered in determining if the record is unique or duplicate? If the Division and User pair is duplicated for any MRN and APPT MADE DATE pair then the record is duplicated and one must be removed?
    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
    scheibla is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    2
    Yes, but all copies must be removed - not just one of them. It is a different type of scheduling if Division and User are duplicated than if they are not. I am trying to determine what % of each type of scheduling we do.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Provide sample data to test with. Can be an Access or Excel. Follow instructions at bottom of my post.
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 03-30-2012, 11:18 AM
  2. Replies: 2
    Last Post: 03-30-2012, 10:50 AM
  3. Delete Query Question
    By Madmax in forum Access
    Replies: 1
    Last Post: 09-23-2011, 06:05 AM
  4. access 2010 vba question
    By jscriptor09 in forum Access
    Replies: 1
    Last Post: 08-26-2011, 06:57 AM
  5. ACCESS 2010 vba question
    By jscriptor09 in forum Access
    Replies: 1
    Last Post: 07-26-2011, 03:55 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