A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

append table query



 
 
Thread Tools Display Modes
  #1  
Old July 11th, 2008, 05:16 PM posted to microsoft.public.access.queries
chilli_Novice
external usenet poster
 
Posts: 1
Default append table query

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

  #2  
Old July 11th, 2008, 06:19 PM posted to microsoft.public.access.queries
Michel Walsh[_2_]
external usenet poster
 
Posts: 56
Default append table query

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

"chilli_Novice" wrote in message
...
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


  #3  
Old July 11th, 2008, 06:35 PM posted to microsoft.public.access.queries
chilli_Novice[_2_]
external usenet poster
 
Posts: 1
Default append table query

Thanks for the help Michel that did the trick.

"Michel Walsh" wrote:

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

"chilli_Novice" wrote in message
...
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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.