Results 1 to 8 of 8
  1. #1
    rkaiman is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    1

    How to Find Unmatched Fields in a Single Table

    Here's some sample data. I want to compare the date in TX-Date Filled to the date in RX-LsDte Filled*Cent. If the dates are DIFFERENT I ultimately want to delete that row from my table.

    I have tried importing the data into two seperate tables and creating a "find unmatched" query. It does provide the results I want, but the results are read-only so I cannot delete the results.

    What is the best way to handle this? I am intermediate in skill so your help is appreciated. In the image below the first two rows are what I want to delete from my data because the dates in the first two columns do not match. I will be running this on 1000's of records weekly.



    Thank you,


    Click image for larger version. 

Name:	table.PNG 
Views:	13 
Size:	30.8 KB 
ID:	14981

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,628
    Bing: query delete duplicate record
    Review http://support.microsoft.com/kb/139444
    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
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Generally

    SELECT...
    FROM...
    WHERE Field1 <> Field2
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Quote Originally Posted by June7 View Post
    Bing: query delete duplicate record
    Review http://support.microsoft.com/kb/139444
    But they aren't duplicates.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    As Paul said,

    Try
    Code:
    SELECT [TX-Date], [RX-LsDte Filled*Cent] FROM YourTableName WHERE [TX-Date]<>[RX-LsDte Filled*Cent];
    If the query above only returns records where the dates in the two fields do not match, change the query to
    Code:
    DELETE * FROM YourTableName WHERE TX-Date<>[RX-LsDte Filled*Cent];
    Replace the BLUE text with your table name...

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Hi Steve,

    I hear you the only 1 in North America enjoying a relative heat wave.

    -14C in Ottawa.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,628
    Duplicates based on TX-RXNumber. Sounds like OP wants to delete the older dated records.

    If the TX-DateFilled will always equal RX-LsDte Filled*Cent in the most recent record, query that deletes all where they aren't equal should work.

    Yep, 25F today.
    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.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Yes, it is a blistering 28F (-2.2C) here today.

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

Similar Threads

  1. Multiple Find Unmatched
    By dr4ke1990 in forum Queries
    Replies: 13
    Last Post: 11-08-2013, 10:41 AM
  2. Replies: 7
    Last Post: 03-28-2013, 06:41 AM
  3. Unmatched Query to find Changed info between tables
    By michael.p.ryan1 in forum Access
    Replies: 3
    Last Post: 08-24-2012, 02:22 PM
  4. Replies: 1
    Last Post: 12-08-2011, 01:52 PM
  5. Replies: 1
    Last Post: 08-30-2011, 07:35 AM

Tags for this Thread

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