append table query

  • Thread starter Thread starter chilli_Novice
  • Start date Start date
C

chilli_Novice

I need to append the results of a query into a table and one of the fields
needs to have a value that is not a part of the query results. Is there a
way to do this?

e.g.
field 1, field 2, field 3, field 4(not in result of query)
apple, 1.59, 1.99, Fruit
orange, 1.49, 1.99, Fruit
grapes, 0.99, 1.29, Fruit
 
In SQL view:


INSERT INTO tableName (field1, field2, field3, field4)
SELECT field1, field2, field3, "Fruit"
FROM tableWithData



In other words, supply the missing field with the required expression, such
as, here, the string constant "Fruit".


In the query designer, make the append query, bring the three available
fields in the grid, and, for the fourth one, type "Fruit" in the first
line (or whatever expression fits). Fill the other elements of the grid, as
supplying the name of the fields that will receive the fields/expression in
the first line of the grid.


Vanderghast, Access MVP
 
Thanks for the help Michel that did the trick.

Michel Walsh said:
In SQL view:


INSERT INTO tableName (field1, field2, field3, field4)
SELECT field1, field2, field3, "Fruit"
FROM tableWithData



In other words, supply the missing field with the required expression, such
as, here, the string constant "Fruit".


In the query designer, make the append query, bring the three available
fields in the grid, and, for the fourth one, type "Fruit" in the first
line (or whatever expression fits). Fill the other elements of the grid, as
supplying the name of the fields that will receive the fields/expression in
the first line of the grid.


Vanderghast, Access MVP
 
Back
Top