MS Access Query - specify table i want to delete from

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JonHuff
    New Member
    • Sep 2010
    • 14

    MS Access Query - specify table i want to delete from

    i am getting an error try to run query:

    Code:
    DELETE *
    FROM tblExceptions INNER JOIN tblTemp3 ON tblExceptions.ExceptionKey=tblTemp3.ExceptionKey
    WHERE (((tblExceptions.ExceptionLevel)=0));
    it says to specify table to delete from?
    Last edited by MMcCarthy; Oct 6 '10, 09:11 PM. Reason: added code tags
  • dsatino
    Contributor
    • May 2010
    • 393

    #2
    I don't think you can use the * with DELETE queries that have a JOIN because both tables have a * option.

    Your query doesn't specify which tables * you want to delete.

    You could try to modify the SQL to DELETE tblExceptions.*

    But I have no idea whether Access will recognize what you are trying to do

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Essentially you can't use a delete query on a query with a join like this. Try this instead ..

      Code:
      DELETE * FROM tblExceptions
      WHERE ExceptionKey=DLookup("[ExceptionKey]","tblTemp3","[ExceptionLevel=0");

      Comment

      Working...