Copy Columns

  • Thread starter Thread starter jay
  • Start date Start date
J

jay

How can you copy a column from a query to a table.
Is this possible and which way would be the easiest?
I am using access office 2002 and would like to do this.
 
jay said:
How can you copy a column from a query to a table.
Is this possible and which way would be the easiest?
I am using access office 2002 and would like to do this.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do you mean create a new column in a table & then transfer data from one
table's column into the new column? You'd have to use DDL:

ALTER TABLE table_name ADD COLUMN column_name <data type> <column
properties>

See the Access Help article "ALTER TABLE" from more info.

Then copy the data in:

INSERT INTO table_name (column_name)
SELECT other_column_name FROM other_table_name WHERE <criteria>

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQbThh4echKqOuFEgEQJ4kQCeMddKp2h3JFrAzRzABuXr8Va8JbcAnA+l
gxusZpxnMCh6fiuBnfphi+3M
=uyNU
-----END PGP SIGNATURE-----
 
I'm not sure I understand your question.

Given that queries are based on tables, what is you're trying to copy from
where to where?
 
MGFoster said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do you mean create a new column in a table & then transfer data from one
table's column into the new column? You'd have to use DDL:

ALTER TABLE table_name ADD COLUMN column_name <data type> <column
properties>

See the Access Help article "ALTER TABLE" from more info.

Then copy the data in:

INSERT INTO table_name (column_name)
SELECT other_column_name FROM other_table_name WHERE <criteria>



I have a column in a query that I want to have copied to a column in
a table.
Let's say copy D column from the query to C column in the table.
That means all cells in the D query column goes to the C column in the
table.


MyQuery Query

A B C D


MyTable Table

A B C
 
jay said:
MGFoster wrote:





I have a column in a query that I want to have copied to a column in
a table.
Let's say copy D column from the query to C column in the table.
That means all cells in the D query column goes to the C column in the
table.


MyQuery Query

A B C D


MyTable Table

A B C

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I believe I answered your Q in my previous post, but I'll supply an
answer that more specifically answers your Q:

INSERT INTO myTable (C)
SELECT D FROM myQuery

This INSERT statement reads column D data from myQuery and inserts it
into myTable's column C. Is that what you wanted?

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQbUNWIechKqOuFEgEQJFWACfVOv44LWrHBOCOAlkAamA3LCaXLoAoOhn
b2VY4uEaD1F08ptVDmIoM41x
=P6Zy
-----END PGP SIGNATURE-----
 
Back
Top