Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    delete query (Access 2000)

    i have a delete query that doesnt work.I have 2 tables, orders and customers, related with one to may relationship I have i field in the customers table named afid by which i mean affiliate. I want o delete all the orders which do not belong to affiliate Nr 4 but i cannot do it.Can somebody help me?
    My sql is the following

    DELETE orders.*, customers.afid
    FROM customers INNER JOIN orders ON (customers.Customerid = orders.customerid) AND (customers.Customerid = orders.customerid)
    WHERE (((customers.afid)<>4));

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: delete query (Access 2000)

    When you say you cannot do it, do you mean you get an error message or what? In Access 2000 some things changed in the query engine. Try this:

    DELETE DISTINCTROW orders.*
    FROM customers INNER JOIN orders ON (customers.Customerid = orders.customerid) WHERE (((customers.afid)<>4));
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •