Results 1 to 4 of 4
  1. #1
    brijesh.dayal is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    2

    Adding columns and updating values in a access table using a single query

    I have a table in access 2007 "Table1". I want to add new columns in "Table1" and want to update values in these columns from another table "Table2". Is there any way to design a single query to do these two tasks?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    No. Must first ALTER the table then run UPDATE to populate the new fields.

    Why do you need to add fields? Is this a periodic event? If so, sounds like data structure might not be optimal.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    brijesh.dayal is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    2
    Quote Originally Posted by June7 View Post
    No. Must first ALTER the table then run UPDATE to populate the new fields.

    Why do you need to add fields? Is this a periodic event? If so, sounds like data structure might not be optimal.
    Thanks for the reply. I have to add fields bcoz while creating new table through make table query some fields may not be defined as they don't have any default values. The values for these fields are to be updated from other table after creating the first table. If I define these fields while creating the table as null, the data type appears as binary. Thereafter if I update these fields from other table, unexpected data appears in these fields.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Why do you need to create table by query?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-17-2012, 03:52 PM
  2. Replies: 4
    Last Post: 05-14-2012, 10:15 AM
  3. Replies: 9
    Last Post: 01-03-2012, 11:35 AM
  4. Replies: 7
    Last Post: 11-13-2010, 08:08 AM
  5. Replies: 1
    Last Post: 10-09-2009, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums