Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

How to copy data from one field to another field ?

Discussion in 'Information Technology' started by Martin \(Martin Lee\), Jul 28, 2006.

Tags:
  1. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    I have a field called [abc] in a table, with lots of data. Now, I want to
    add another field called [abc1] in this table, and, to begin with this new
    field, I need to copy all the existed data in [abc] into [abc1]. How to
    make this?

    Thanks!

    Martin Lee
     
  2. Loading...

    Similar Threads Forum Date
    Opinion Akal Takht concerned on drug addiction, copying during exams Breaking News Nov 5, 2013
    SciTech New Quantum Dot Technique Combines Best of Optical and Electron Microscopy Breaking News Jun 17, 2013
    India Copy of 48th Rreport of 'LOKPAL BILL 2011' Presented in Parliament Breaking News Dec 10, 2011
    Bhagats Sheikh Farid Copyright? History of Sikhism Nov 14, 2011
    Christianity Public library find is only surviving copy of rebel hymn book Interfaith Dialogues Jan 8, 2011

  3. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    Hi Martin,

    You simply need to use an Update query to update the values in your new
    field with the values from your existing field. Create a new query. Dismiss
    the Add Tables dialog without adding any tables. In query design view, click
    on View > SQL View. You should see the word SELECT highlighted. Copy the
    following SQL statement (Ctrl C) and paste it into the SQL view (Ctrl V),
    replacing the SELECT keyword:

    UPDATE [TableName] SET [TableName].[abc1] = [abc];


    where you substitute "TableName" with the actual name of your table.

    You can then switch back to the more familiar design view, if you wish, by
    clicking on View > Design View. Run the query.


    Tom Wickerath
    Microsoft Access MVP

    http://www.access.qbuilt.com/html/expert_contributors.html
    http://www.access.qbuilt.com/html/search.html
    __________________________________________


    "Martin (Martin Lee)" wrote:

    > I have a field called [abc] in a table, with lots of data. Now, I want to
    > add another field called [abc1] in this table, and, to begin with this new
    > field, I need to copy all the existed data in [abc] into [abc1]. How to
    > make this?
    >
    > Thanks!
    >
    > Martin Lee
    >
    >
    >
     
  4. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    UPDATE [TableName] SET [TableName].[abc1] = [abc];

    if [abc] belongs to another table called [TableName2], how to do it ? I
    tried ..... = [TableName2].[abc] but failed.

    Martin Lee



    "Tom Wickerath" <AOS168b AT comcast DOT net> дÈëÏûÏ¢ÐÂÎÅ:BE8A3B19-A968-4874-BB12-2B374CA68C64@microsoft.com...
    > Hi Martin,
    >
    > You simply need to use an Update query to update the values in your new
    > field with the values from your existing field. Create a new query.
    > Dismiss
    > the Add Tables dialog without adding any tables. In query design view,
    > click
    > on View > SQL View. You should see the word SELECT highlighted. Copy the
    > following SQL statement (Ctrl C) and paste it into the SQL view (Ctrl V),
    > replacing the SELECT keyword:
    >
    > UPDATE [TableName] SET [TableName].[abc1] = [abc];
    >
    >
    > where you substitute "TableName" with the actual name of your table.
    >
    > You can then switch back to the more familiar design view, if you wish, by
    > clicking on View > Design View. Run the query.
    >
    >
    > Tom Wickerath
    > Microsoft Access MVP
    >
    > http://www.access.qbuilt.com/html/expert_contributors.html
    > http://www.access.qbuilt.com/html/search.html
    > __________________________________________
    >
    >
    > "Martin (Martin Lee)" wrote:
    >
    >> I have a field called [abc] in a table, with lots of data. Now, I want to
    >> add another field called [abc1] in this table, and, to begin with this
    >> new
    >> field, I need to copy all the existed data in [abc] into [abc1]. How to
    >> make this?
    >>
    >> Thanks!
    >>
    >> Martin Lee
    >>
    >>
    >>
     
  5. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    Hi Martin,

    For some reason, your last reply does not show up in the MS web portal, but I found it by using
    the Outlook Express newsreader that I have previously configured:
    http://www.microsoft.com/office/com...cess&mid=be8a3b19-a968-4874-bb12-2b374ca68c64

    You need to have a field, or a combination of fields, that you can create a link between the
    tables. For the purposes of this example, I simply added a numeric filed named "ID1" to the table
    named "TableName", and a numeric field named "ID2" to the table named "TableName2". Then I added
    values to the ID fields in both tables. Then use the following query:

    UPDATE TableName2
    INNER JOIN TableName ON TableName2.ID2 = TableName.ID1
    SET TableName.abc1 = [TableName2].[abc];

    Perhaps you already have some fields that can serve to join the two tables, so you won't need to
    add these ID fields. You need to create the join, to pair up the records in each table, in order
    to prevent a Cartesian product result.


    Tom
    _______________________________________________

    "Martin (Martin Lee)" wrote in message news:eyUUx25gGHA.3756@TK2MSFTNGP02.phx.gbl...

    UPDATE [TableName] SET [TableName].[abc1] = [abc];

    if [abc] belongs to another table called [TableName2], how to do it ? I
    tried ..... = [TableName2].[abc] but failed.

    Martin Lee

    _______________________________________________

    "Tom Wickerath" <AOS168b AT comcast DOT net>
    дÈëÏûÏ¢ÐÂÎÅ:BE8A3B19-A968-4874-BB12-2B374CA68C64@microsoft.com...

    > Hi Martin,
    >
    > You simply need to use an Update query to update the values in your new
    > field with the values from your existing field. Create a new query.
    > Dismiss
    > the Add Tables dialog without adding any tables. In query design view,
    > click
    > on View > SQL View. You should see the word SELECT highlighted. Copy the
    > following SQL statement (Ctrl C) and paste it into the SQL view (Ctrl V),
    > replacing the SELECT keyword:
    >
    > UPDATE [TableName] SET [TableName].[abc1] = [abc];
    >
    >
    > where you substitute "TableName" with the actual name of your table.
    >
    > You can then switch back to the more familiar design view, if you wish, by
    > clicking on View > Design View. Run the query.
    >
    >
    > Tom Wickerath
    > Microsoft Access MVP
    >
    > http://www.access.qbuilt.com/html/expert_contributors.html
    > http://www.access.qbuilt.com/html/search.html
    > __________________________________________
    >
    >
    > "Martin (Martin Lee)" wrote:
    >
    >> I have a field called [abc] in a table, with lots of data. Now, I want to
    >> add another field called [abc1] in this table, and, to begin with this
    >> new
    >> field, I need to copy all the existed data in [abc] into [abc1]. How to
    >> make this?
    >>
    >> Thanks!
    >>
    >> Martin Lee
     
  6. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    Wouldn't you know it....as soon as I sent a reply using Outlook Express,
    because I could not see your message using the web portal, it showed up just
    fine. Go figure. Oh well.


    Tom Wickerath
    Microsoft Access MVP

    http://www.access.qbuilt.com/html/expert_contributors.html
    http://www.access.qbuilt.com/html/search.html
    __________________________________________

    "Tom Wickerath" wrote:

    > Hi Martin,
    >
    > For some reason, your last reply does not show up in the MS web portal,
    > but I found it by using the Outlook Express newsreader that I have previously
    > configured...


    <snip>
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page