Results 1 to 2 of 2

Thread: SQL copy data from column

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    90

    SQL copy data from column

    hello there,

    how is it possible that i can copy data from an entire column (A) into another column (B), within the same table.

    i am doing this because i have difficulties in renaming columns.

    thank you very much.

    note: MS Access 03 VBA

    Astro.

  2. #2
    Fanatic Member dannymking's Avatar
    Join Date
    Jul 2005
    Location
    Darlington, North East UK
    Posts
    677

    Re: SQL copy data from column

    With SQL?

    Two calls..
    VB Code:
    1. CurrentDb.Execute "ALTER TABLE tablename ADD COLUMN NewField type NULL"
    2. CurrentDb.Execute "UPDATE tablename SET NewField=OldField"

    Where type in the first SQL represents the field type that you are creating...

    For more info try ALTER TABLE - SQL Command

    Although this relates more to SQL Server it is possible to do this as a Hidden SQL option on Access
    Danny

    Never Think Impossible

    If you find my answer helpful then please add to my reputation

Posting Permissions

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



Click Here to Expand Forum to Full Width