Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003
    Posts
    74

    Unanswered: UPDATE - pls help with Update syntax !!!

    Hi,
    I have to go into work tomorrow knowing how to update in Access - so I don't have time to figure it out for myself by trial and error and I would really appreciate some help urgently.

    Is this the correct syntax ?
    UPDATE table_1
    SET field_1 = (SELECT field_2
    FROM table_2
    WHERE table_1.join_field_1 = table_2.join_field_2)

    I will be very grateful to anyone who has time to respond before I wake up in the morning !!!

    Thanks very much.

    B.Dimple
    Junior DBA

  2. #2
    Join Date
    Jul 2003
    Location
    Canberra, ACT Australia
    Posts
    53
    I'd be inclined to put another set of () around the where statement ie where(.....).

    Also, you might consider making a dummy select query and converting it to an update query via the buttons in access, and then viewing the SQL.

    Cheers

  3. #3
    Join Date
    Jul 2003
    Location
    Canberra, ACT Australia
    Posts
    53
    sorry. Ignore the first part of my earlier response. On re-reading your current syntax it looks to me that you are attempting to update field1 in table1 to the value in field2 table2, but you are attempting a join by which the selct process will only find those records where field1 table1 already matches field2 table2. Could you explain a little more as to what you are attempting to achieve?

    cheers

  4. #4
    Join Date
    Jul 2003
    Posts
    74
    Hi,

    Thanks for your prompt reply.

    You are right, that I got my rough SQL wrong - that's what happens when you try to rush things at midnight !

    I found a workaround so I managed to sidestep the problem.

    But thanks again for you time.

    B.Dimple.

Posting Permissions

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