Results 1 to 6 of 6
  1. #1
    winterh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    110

    How do I copy all the data from a Column

    How do I copy all the data from one column to a new column within the same table.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    I'd try something like this:

    Set up a test before doing this to your production data

    Adjust table structure to include the new field/column

    UPDATE myTable
    set NewFieldname = OldFieldname

  3. #3
    winterh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    110
    ideally i want to keep both columns until i have the testing on the reporting

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    Yes, the intent of this set up will keep the data in 2 columns.
    Code:
    Original
    id  oldfield
    1   abc
    2   xvz
    
    With new column
    
    id oldfield  newfield
    
    after the Update query
    
     id  oldfield  newfield
    1   abc       abc
    2   xvz       xvz

  5. #5
    winterh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    110
    Cheers Mate, when I run the query I get a message along theline of data violation, could this be due to one of the columns being text andthe second one getting the data from a seconded table.

  6. #6
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    This was your original question
    How do I copy all the data from one column to a new column within the same table
    .

    Where does the second table come from?
    andthe second one getting the data from a seconded table.
    I just ran a test on a sample database and the query works fine.

    UPDATE TUTOR SET TUTOR.newField = [Name];

    YES the new field/column must be the same data type as the original field/column.
    Attached Thumbnails Attached Thumbnails Redesign.jpg  

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

Similar Threads

  1. Copy data from one form to another.
    By Gamberick in forum Forms
    Replies: 5
    Last Post: 01-18-2012, 02:26 AM
  2. Replies: 1
    Last Post: 12-08-2011, 08:03 AM
  3. Replies: 1
    Last Post: 08-18-2011, 08:35 AM
  4. Copy data from one form to another
    By rcrobman in forum Programming
    Replies: 12
    Last Post: 05-24-2011, 01:25 PM
  5. Copy data from Tables in VBA
    By MattyT in forum Programming
    Replies: 4
    Last Post: 12-24-2010, 10:07 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