Results 1 to 2 of 2
  1. #1
    tushar05 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    1

    Delete Query Help Needed

    Hi,
    I am new to Access. Can someone please me with following query.
    It compares data from two tables and deletes entry from table 1 for entries in table 2.


    I have two tables with one field each.

    Sample data-
    Table 1:Field1-
    A
    B
    C
    B

    Table 2:Field1-
    B

    Expected Query Result
    A
    C
    B



    Thanks in advance for help.
    Tushar

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,028
    If there is only one field, why do you need to compare against table 2? Do you want to actually delete the record from the table or just not show duplicate records in query?

    I will suggest a way to query without deleting and show only unique values. Use DISTINCT keyword. Type it into the query in the SQL View editor.

    SELECT DISTINCT Field1 FROM table1;

    Now if you want table without duplicates, make a table based on the query. Eliminate table1 and table2.
    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. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM
  2. Replies: 11
    Last Post: 03-30-2011, 01:08 PM
  3. Query help needed on a one to many sum
    By devphreak in forum Queries
    Replies: 3
    Last Post: 02-25-2011, 10:49 AM
  4. Help needed with Query...
    By showmak in forum Queries
    Replies: 4
    Last Post: 09-10-2010, 07:23 PM
  5. Query help needed asap!!
    By msaccess09 in forum Queries
    Replies: 1
    Last Post: 02-25-2009, 09:39 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 - Senior Forums