Results 1 to 4 of 4
  1. #1
    murukessan is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Aug 2012
    Posts
    3

    Selectively delete entries from two tables

    Hello everyone,
    Consider two tables A and B
    A
    no year
    1 2000
    2 2001
    3 2000
    4 2002

    B
    no
    1
    1
    1
    2
    2
    3
    3
    4

    What i want to do is delete from A all those entries that have "year" field as "2000" and before doing so i want to delete all the entries in B those "no" field matches the "no" field of A where its "year" column is "2000"

    What i want after the operations is the following set of tables
    A
    no year
    2 2001
    4 2002

    B
    no
    2
    2
    4




    Thanks in advance
    murukessan

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Using SQL:

    First: "Delete from B where [No] in (Select [No] from A where [year] = 2000)"
    then
    "Delete from A where [Year] = 2000"

    John

  3. #3
    murukessan is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Aug 2012
    Posts
    3
    Thanks a lot for your response

  4. #4
    murukessan is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Aug 2012
    Posts
    3
    It worked well thanks again....muru

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

Similar Threads

  1. Hide Duplicates selectively
    By SpaceEd in forum Reports
    Replies: 14
    Last Post: 11-03-2011, 01:24 PM
  2. Common entries within multiple tables
    By JesterMania in forum Queries
    Replies: 4
    Last Post: 08-02-2011, 02:57 PM
  3. Sum of entries from seperate tables/queries
    By krutoigoga in forum Queries
    Replies: 4
    Last Post: 07-07-2011, 11:54 AM
  4. Count date entries from seperate tables/queries
    By krutoigoga in forum Queries
    Replies: 3
    Last Post: 06-30-2011, 12:48 PM
  5. Using data in the import to selectively insert
    By mrbaggins in forum Import/Export Data
    Replies: 4
    Last Post: 11-25-2010, 06:08 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