Syntax error in query expression


Happy New Year to all of you

The following query is not accepted by Access and the mesage is " Syntax error in query expression".


DELETE [order details].orderid, *FROM [order details]WHERE ((([order details].orderid) In (SELECT [order details].OrderID FROM [order details] LEFT JOIN [order

details]1 ON [order details].OrderID = [order details1].OrderID WHERE (([order details1].OrderID) Is Null))))"

May i ask for help ?? Actually i have rewritten the code from a similar query, which is accepted by Access.This query is the following:

DELETE Orders.orderid, *
FROM Orders
WHERE (((Orders.orderid) In (SELECT Orders.OrderID FROM Orders LEFT JOIN Orders1 ON Orders.OrderID = Orders1.OrderID WHERE ((Orders1.OrderID) Is

Null))));


Perhaps somebody might help me and show me how can i delete my first query, containing 2 similar tables which are
order details and order details1,
and deleting those records that do no exist in the table order details1.



Comments

  • I have done something similar, but copied the records from my first table into the second and ran a "find duplicates" query. It's "cheating", but it worked for me! :-) Kim




    :
    : Happy New Year to all of you
    :
    : The following query is not accepted by Access and the mesage is " Syntax error in query expression".
    :
    :
    : DELETE [order details].orderid, *FROM [order details]WHERE ((([order details].orderid) In (SELECT [order details].OrderID FROM [order details] LEFT JOIN [order
    :
    : details]1 ON [order details].OrderID = [order details1].OrderID WHERE (([order details1].OrderID) Is Null))))"
    :
    : May i ask for help ?? Actually i have rewritten the code from a similar query, which is accepted by Access.This query is the following:
    :
    : DELETE Orders.orderid, *
    : FROM Orders
    : WHERE (((Orders.orderid) In (SELECT Orders.OrderID FROM Orders LEFT JOIN Orders1 ON Orders.OrderID = Orders1.OrderID WHERE ((Orders1.OrderID) Is
    :
    : Null))));
    :
    :
    : Perhaps somebody might help me and show me how can i delete my first query, containing 2 similar tables which are
    : order details and order details1,
    : and deleting those records that do no exist in the table order details1.
    :
    :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion