Results 1 to 5 of 5
  1. #1
    haydenbl is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    11

    Deleting duplicates with leaving the most current date

    Hello All,



    I am using Access 2007-2010. I have a table that contains a member number and a transaction date. I need to remove the duplicate while leaving the record with the most current date. I know that I can use a query to write out the data by saying the member number is unique, but how do I determine which is the most current date?

    Thanks

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Why are you deleting information, that's a pretty dangerous practice. The whole point of having a database is that you have the ability to look at historical and current data with equal ease.

    It would be a far better practice to just design a query that showed you only the most recent record(s) by date.

  3. #3
    haydenbl is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    11
    Quote Originally Posted by rpeare View Post
    Why are you deleting information, that's a pretty dangerous practice. The whole point of having a database is that you have the ability to look at historical and current data with equal ease.

    It would be a far better practice to just design a query that showed you only the most recent record(s) by date.
    I would be alright if I didn't delete the data, I just need a query that would only show me the data without the dups with the most current date shown.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    does your 'duplicate' have identical data for all fields, or does it vary from record to record?

    So let's say you have MEMBER 1, but they have two records on 1/1/2013, how are you determining which is the 'correct' record to show?

    is there also a time in the date field i.e. 1/1/2013 2:00:00 PM?

    should there NEVER be a duplicate date for the same member?

    If there should never be a duplicate is there a reason you allow it in your table design?

    it's easy to find the most recent date for any particular member

    SELECT MEMBER, MAX(DATEFIELD) AS MostRecentDate FROM tblTableName GROUP BY MEMBER

    This'll show you the most recent date of activity for each member.

  5. #5
    haydenbl is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    11
    Thank you that is exactly what I am needing. I appreciate the help.

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

Similar Threads

  1. Replies: 6
    Last Post: 12-11-2012, 09:40 PM
  2. Replies: 25
    Last Post: 11-16-2012, 12:47 PM
  3. Replies: 3
    Last Post: 10-25-2012, 10:04 PM
  4. Deleting current record using VBA
    By Kivan in forum Programming
    Replies: 3
    Last Post: 08-07-2012, 11:31 AM
  5. Deleting Duplicates
    By TundraMonkey in forum Queries
    Replies: 4
    Last Post: 09-08-2009, 07:13 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