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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem in Inserting a single row from one table to another

Status
Not open for further replies.

tondarb

Programmer
Oct 8, 2003
37
US
I am having a table named table1 in which I am having details of customers. I want to insert a particular customer details to another table2( which is same as the table1)
I know in Sql we can use Insert.....

Insert into table2 select * from table1 where cusno='A001'

but in access it is not working. I am able to insert all rows but in this case I want to insert a single row using condition. can anyone is there to help me

thanks in advance
 
Hi

You should be able to do as you say (ie use INSERT INTO ..etc), could you expand on 'not working' what actually happens, do you get an error message?

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
thanks for the response.

Yes I know it must work but It is updating 0 rows.

It is giving the message "You are about to append 0 rows"

 
It must return the details of that particular customer from table1 to table2
thanks for the response

 
Hi

NO do not tell me what it MUST return, tell me what it DOES return, if your Insert statement said inserting 0 rows, then I suspect you will find the SELECT statement will return no rows, suggesting you have the SELECt statement wrong in some way

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Yes you are correct here the select statement is returning 0 rows.
but I tried the same in SQl ,insert statement is working there. It is inserting the contents of table1 to table2. So I think the statement is correct but some minor mistake I have done.

I don't know much about access .
any way thanks for your suggestion.
regards

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top