Delete based on another table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Haas C

    Delete based on another table

    Hi all!

    I am new to this and trying to learn as best as i can. This group is
    defiintely helpful in that regards. Anyways, I was wondering if
    someone can help me with this:

    I have a table called for example BigTable and I have another smaller
    table called SmallTable - both tables are joined at the Account field.
    I want to set up a query in Access which would allow me to delete all
    records from BigTable which are NOT in SmallTable based on the Account
    field. I've been trying to figure this out and can't seem to do so -
    please help! Let me know if you have any further questions.

    I thank you all in advance for your help.

    -Haas
  • Tom van Stiphout

    #2
    Re: Delete based on another table

    On Wed, 17 Sep 2008 14:15:27 -0700 (PDT), Haas C <haas786@yahoo. com>
    wrote:

    Interesting how you unconsciously gave a major part of the answer
    yourself:
    delete from BigTable
    where Account NOT IN (select Account from SmallTable)

    -Tom.
    Microsoft Access MVP


    >Hi all!
    >
    >I am new to this and trying to learn as best as i can. This group is
    >defiintely helpful in that regards. Anyways, I was wondering if
    >someone can help me with this:
    >
    >I have a table called for example BigTable and I have another smaller
    >table called SmallTable - both tables are joined at the Account field.
    >I want to set up a query in Access which would allow me to delete all
    >records from BigTable which are NOT in SmallTable based on the Account
    >field. I've been trying to figure this out and can't seem to do so -
    >please help! Let me know if you have any further questions.
    >
    >I thank you all in advance for your help.
    >
    >-Haas

    Comment

    • Haas C

      #3
      Re: Delete based on another table

      On Sep 17, 11:26 pm, Tom van Stiphout <tom7744.no.s.. .@cox.netwrote:
      On Wed, 17 Sep 2008 14:15:27 -0700 (PDT), Haas C <haas...@yahoo. com>
      wrote:
      >
      Interesting how you unconsciously gave a major part of the answer
      yourself:
      delete from BigTable
      where Account NOT IN (select Account from SmallTable)
      >
      -Tom.
      Microsoft Access MVP
      >
      >
      >
      Hi all!
      >
      I am new to this and trying to learn as best as i can. This group is
      defiintely helpful in that regards. Anyways, I was wondering if
      someone can help me with this:
      >
      I have a table called for example BigTable and I have another smaller
      table called SmallTable - both tables are joined at the Account field.
      I want to set up a query in Access which would allow me to delete all
      records from BigTable which are NOT in SmallTable based on the Account
      field. I've been trying to figure this out and can't seem to do so -
      please help! Let me know if you have any further questions.
      >
      I thank you all in advance for your help.
      >
      -Haas- Hide quoted text -
      >
      - Show quoted text -
      LOL. Thanks!! Shoulda listened to myself. Appreciate the help!

      Comment

      Working...