INSERT INTO problem

ovello

Registered User.
Local time
Today, 11:02
Joined
Jul 14, 2005
Messages
17
I have a table SL with some fields, the first of them are: CODNOU and CODADR. I have a query test with some fields, the first of them are COD_NOU and COD_ADR. I made the following query:

INSERT INTO SL ( CODNOU, CODADR )
SELECT COD_NOU, COD_ADR
FROM test;

which intends to insert the data from test qry into to the table SL. Unfortunatelly when I run the qry a message occures and invites me to input the parameter value for COD_NOU. If I avoid using the field COD_NOU in the wry, the qry works correctly. What`s wrong?

Thank you in advance!
 
Last edited:
Why do you need to base your append query on another query? Can't you simply edit test to turn this into an append query? I think the problem may be that until test is run, the fields you are selecting don't exist.
 
ovello said:
I have a table SL with some fields, the first of them are: CODNOU and CODADR. I have a query test with some fields, the first of them are COD_NOU and COD_ADR. I made the following query:

INSERT INTO SL ( CODNOU, CODADR )
SELECT COD_NOU, COD_ADR
FROM test;

which intends to insert the data from test qry into to the table SL. Unfortunatelly when I run the qry a message occures and invites me to input the parameter value for COD_NOU. If I avoid using the field COD_NOU in the wry, the qry works correctly. What`s wrong?

Thank you in advance!

You can try:
INSERT INTO SL ( CODNOU, CODADR )
SELECT Test.[COD_NOU], test.[COD_ADR]
FROM test;

or better yet:

INSERT INTO SL ( CODNOU, CODADR )
SELECT COD_NOU, COD_ADR
FROM basetable
WHERE input criteria;
 

Users who are viewing this thread

Back
Top Bottom