Delete Query Access2000

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MichaelR
    New Member
    • Dec 2008
    • 1

    Delete Query Access2000

    Help, i'm new to this.
    I'm trying to run a delete query in Access 2000 and the error message i get is: 'Could not delete from specified tables'

    I want to delete ProductMaster.[PART NO] that does not exist in [FINAL MASTER].[PART NO], what have i done wrong?


    The SQL for the query is:
    SELECT ProductMaster.* , [FINAL MASTER].[PART NO]
    FROM [FINAL MASTER] RIGHT JOIN ProductMaster ON [FINAL MASTER].[PART NO] = ProductMaster.[PART NO]
    WHERE ((([FINAL MASTER].[PART NO]) Is Null));
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    Try something like this:
    DELETE * FROM ProductMaster WHERE NOT EXISTS (SELECT Part_No FROM FinalMaster WHERE ProductMaster.P art_No = FinalMaster.Par t_No)

    EXISTS examples:
    SQL: EXISTS Condition

    Comment

    Working...