• update query (Access 2000)

    Author
    Topic
    #370765

    I tested the statement:

    UPDATE Orders INNER JOIN Orders1 ON Orders.PaymentID = Orders1.PaymentID SET Orders.BankID = [Orders1].[BankID], Orders.InvoiceDate = [Orders1].[InvoiceDate], Orders.PaymentMethodID = [Orders1].[PaymentMethodID];

    and for each joined PaymentID, it updated the 3 fields in Orders to the values in Orders1.

    You will need to change the joined field from PaymentID (I didn’t see what you were joining on, so I used PaymentID) to yourjoinfield and add PaymentID to the SET clause so it’s values will change as well. HTH

    Viewing 0 reply threads
    Author
    Replies
    • #587407

      Can i have a help with an Update query? I want to update the fields paymentid,bankid,invoicedate and Paymentmethodid
      from the table orders to be equal to the same fields in the table orders1.In other words, i want to insert the values from the table orders1 into the table orders.The values in the table orders are in fact old values and the values in the table orders1 are the new values.
      I am confused about the expressions Insert Into and Update and i cannot handle the wizard.
      Below are the two select clauses,just for orientation.

      SELECT orders.paymentid, orders.bankid, orders.invoicedate, orders.PaymentMethodID
      FROM orders;

      SELECT orders1.paymentid, orders1.bankid, orders1.invoicedate, orders1.PaymentMethodID
      FROM orders1;

      I suppose the code shoud read
      Update orders ( or orders1? i am not sure) .paymentid SET orders.paymentid = orders1.paymentid, orders1.bankid = orders1.bankid

      but what i write did not make sense to me.Shall i write InsertInto instead of Update?

    Viewing 0 reply threads
    Reply To: update query (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: