Appending a column from a query resultset to a table

  • Thread starter Thread starter Harsh Ranade
  • Start date Start date
H

Harsh Ranade

Hi,

I want to add a new column (Ratio)obtained from a query to
a table. How do I do this ? I have tried using the Append
Query but it appends records and not fields. I've been
trying for quite a while. Do I need to uso DAO
programming ??
 
If you want to add a field to the table, how come you
cannot go into the table design and add the field? Then
you can create an UPDATE query with the new ratio values.

If you are having a problem creating a query that has the
formula in the query wizard: Select * from the table Then:
In another query field
type "fldRatio:FieldName1/FieldName2" (do not add the
quotes). This will give you all the fields from your
original table and a field called "fldRatio" with values
but will not alter an existing table.

To alter an existing table open a query in an SQL view and
type:

Alter Table TableName ADD NewFieldName Int NULL;

TableName is the name of the table you want to alter.
NewFieName is the name of the new field you want to add.
Int set the field to an integer and Null sets all the
records for the new field to nothing. You only need to
run this once. You will get an error if you run it more
than once. Then I suppose you can run an Update query
from there.

Marty
 
Back
Top