|
-
Mar 24th, 2005, 02:31 AM
#1
copying data from table one to table two
There are two tables with the same fields say 'firstname' and 'secondname'.
How do I copy all the records from the first table(tableone.mdb) to the second table(tabletwo.mdb) which satisfy the condition that the second name should be 'smith'????
-
Mar 24th, 2005, 05:58 AM
#2
Addicted Member
Re: copying data from table one to table two
use an append query.
if you are using access this is relatively simple using the query builder. have a quick look in the help section
if you want to use SQL then:
Code:
INSERT INTO [Table2] ( [Field 1], Field2)
SELECT Table1.[FIeld 1], Table1.Field2
FROM Table1
WHERE Table1.Surname = "Smith";
if you fail to plan, you plan to fail
-
Mar 24th, 2005, 06:52 AM
#3
Re: copying data from table one to table two
thankx a ton, i'll try that today by the way i am using VB as frontend and access as backend....
Last edited by Siddharth Rout; Mar 24th, 2005 at 07:00 AM.
-
Mar 27th, 2005, 03:04 AM
#4
Addicted Member
Re: copying data from table one to table two
yes it can be used in vb.
you need to declare and set the database object to use it.
Code:
Dim dbs as Database
set dbs = "c:\location of database"
dbs.Execute "COPY SQL STATEMENT HERE"
if you fail to plan, you plan to fail
-
Mar 30th, 2005, 09:21 AM
#5
Re: copying data from table one to table two
Sorry was out of town
will try this code today
appreciate your help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|