Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to insert thru a select

Status
Not open for further replies.

Kalyan Ganesan

Programmer
May 10, 2017
93
US
I have a insert statement in a query in MS ACCESS, the query runs and fetches the data fine but if i use a INSERT INTO TABLE and append it with the query with a select it gives the following error

INSERT INTO statement contains following unknown field name

I have done inserts on other queries and it fails in this query that fetches data,i searched online it says its a bug in Access but there must be a work around

Thanks
 
If you would show us your actual statement,
somebody may be able to help you....

Table definitions of TableA and TableX would be nice, too.

Have fun.

---- Andy

There is a great need for a sarcasm font.
 
Table structure is identical

here is the query

INSERT INTO TABLE1
SELECT *
FROM TABLE1_PROD INNER JOIN TABLE2 ON [TABLE1_PROD].HOME_NUMBER=[TABLE2].HOME_NUMBER;
 
I would never perform an INSERT INTO without fully entering the field names. From your SQL it is fairly clear you will have at least two fields with the same name.

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016
 
You may try:
[tt]
... SELECT [blue]TABLE1_PROD.[/blue]*
FROM ...
[/tt]
If that's what you want.


Have fun.

---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top