Loading ...
Sorry, an error occurred while loading the content.

RE: [SQLQueriesNoCode] Need a little help

Expand Messages
  • Michael Weiss
    I am not sure of the exact syntax in Access, but in SQL Server you would do something like: UPDATE a SET a.myfield = b.fieldx FROM tableA a JOIN tableB b ON
    Message 1 of 2 , Jun 30, 2003
    • 0 Attachment
      I am not sure of the exact syntax in Access, but in SQL Server you would
      do something like:

      UPDATE a
      SET a.myfield = b.fieldx
      FROM tableA a
      JOIN tableB b ON a.primarykeycolumn = b.primarykeycolumn

      One of the techniques that helped me to learn SQL when I started was to
      use the Query Design Grid in Access and build my queries visually. When
      I would make changes in the query, I would change the view from the
      design grid to the SQL display and look at the SQL code that Access
      generated. Anyway, I hope this helps get you a little closer to the
      result you need.
      Michael

      -----Original Message-----
      From: paulmccullochintheuk [mailto:paul.mcculloch@...]
      Sent: Monday, June 30, 2003 1:48 PM
      To: SQLQueriesNoCode@yahoogroups.com
      Subject: [SQLQueriesNoCode] Need a little help

      Hi,

      I want to update a table (Table A) with data from another table
      (Table B), in fact its a complete column (FieldX).

      The primary keys are identical, but Table A has more records

      I thought something like

      UPDATE Table A
      SET FieldX = Table B.FieldX
      FROM Table B
      WHERE ID = TABLE B.ID

      Doesn't seem to want to work in access, anyone set me off in the
      right direction ?

      Paul




      To unsubscribe from this group, send an email to:
      SQLQueriesNoCode-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/
    Your message has been successfully submitted and would be delivered to recipients shortly.