Results 1 to 2 of 2
  1. #1
    Fabdav is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    22

    compare record

    I need a VBA subroutine

    I have a table with many field
    In filed1 i have an ID and in field2 a date like
    1010 10/12/2012
    1010 20/12/2012
    1030 01/01/2012
    1030 12/12/2011

    I need to keep a single record for each unique ID with the newest date value and delete all the other record from the table.

    1010 20/12/2012


    1030 01/01/2012

    Any suggestions?
    Many thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Review http://allenbrowne.com/subquery-01.html

    Look at the example for 'Delete duplicate records'
    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. Compare two fields
    By funkygoorilla in forum Programming
    Replies: 2
    Last Post: 01-18-2012, 09:43 PM
  2. Replies: 2
    Last Post: 12-19-2011, 10:51 AM
  3. Replies: 3
    Last Post: 11-23-2011, 12:25 AM
  4. Compare two fields!
    By finditsol in forum Forms
    Replies: 1
    Last Post: 02-11-2010, 01:43 PM
  5. Replies: 1
    Last Post: 02-26-2009, 11:31 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