Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax error (Access 2000)

    I have a function that is OK. but i want to add on a niew filed called bankid.
    I cannot do it since i get the error :
    syntax error(missing operator) in query expression o1.bankid
    Without bankid, the function works, but not with bamkid.
    I cannot see where my error lies.
    Can somebody help me ?


    StrAppendOrders = "INSERT INTO orders (OrderID, CustomerID, OrderDate, paymentid, PaymentMethodID, input, invoicedate, AuftragNr, bankid) " & _
    " SELECT o1.orderid, o1.customerid, o1.orderdate, o1.paymentid, o1.PaymentMethodID, o1.input, o1.invoicedate, o1.AuftragNr, 01.bankid " & _
    " FROM orders1 As o1 WHERE NOT EXISTS (SELECT * FROM Orders WHERE OrderID=o1.OrderId) "
    CurrentDb.Execute StrAppendOrders

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Syntax error (Access 2000)

    Hi Markus,

    It took a while for me to spot, but this line:<font color=blue>
    " SELECT o1.orderid, o1.customerid, o1.orderdate, o1.paymentid, o1.PaymentMethodID, o1.input, o1.invoicedate, o1.AuftragNr, <font color=red>0</font color=red>1.bankid " & _</font color=blue>
    should have an "o" instead of a zero like this:<font color=blue>
    " SELECT o1.orderid, o1.customerid, o1.orderdate, o1.paymentid, o1.PaymentMethodID, o1.input, o1.invoicedate, o1.AuftragNr, <font color=red>o</font color=red>1.bankid " & _</font color=blue>
    I suspect that's all that is wrong. FYI, I usually use the query tool to debug these kind of problems, by pasting the result into the query designer.
    Wendell

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Syntax error (Access 2000)

    Thank you very much !!!!!!!

Posting Permissions

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