473,503 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy table to table, how?

10 New Member
Hello!

I been working on a problem for a while. I need to copy data from 2 tables and merge them in to 1 table that already exists. i need to extract a column called "bpo" and a column called "usr" from 2 different tables called anv and bpo and then copy them into a table called mybpo.

I guess it shood look something like this:

sql = "INSERT INTO mybpo SELECT usr FROM anv where usr ='" & session("usr") & "' and SELECT bpo FROM bpo "

but i cant get it to work, tried allot of combinations, Please help me

/Regards Phiber
Feb 25 '09 #1
7 2513
ck9663
2,878 Recognized Expert Specialist
Merge as in JOIN or merge as in UNION?

-- CK
Feb 25 '09 #2
phiber102
10 New Member
Hmm not not really sure, since im not that good at sql/database part :D

But what i want is to take data from table "anv" column "usr" and then take out data from table "bpo" column "bpo", and place them into a table called "mybpo" column "usr" and column "bpo". and its important that usr and bpo enter "next to each other"
Feb 25 '09 #3
ck9663
2,878 Recognized Expert Specialist
That looks like a JOINED table. Find a key that can be used to link the table, then read this


-- CK
Feb 25 '09 #4
phiber102
10 New Member
Thank you very much! might have saved my day :D
Feb 25 '09 #5
phiber102
10 New Member
hmm i still cant get it to work, doing this now:

Expand|Select|Wrap|Line Numbers
  1. sql = "INSERT INTO mybpo SELECT bpo FROM bpo JOIN anv ON (usr = '" & session("usr") & "')"
  2.  
but then i get error message Microsoft JET Database Engine (0x80040E14)
Feb 25 '09 #6
ck9663
2,878 Recognized Expert Specialist
1. Display the value of the variable sql.
2. Copy the displayed value
3. Open a query window
4. Paste the value of sql
5. Execute your query.

And check your syntax

-- CK
Feb 25 '09 #7
phiber102
10 New Member
thx again :D appreciate the help
Feb 25 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
10912
by: news.hp.com | last post by:
I have situation where I need to copy multiple records (only certain fields) from a Rules table to an Events table based on a selection identified in a combo box. When the selection is made in a...
3
8337
by: Tlm | last post by:
Hello All, I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also has a subform embedded in it (SubFrmC) The form's recordsource is based on a table (TblA). SubFrmB's...
19
3442
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
7
11600
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
2
2644
by: Janning Vygen | last post by:
hi PGurus, i searched the archives and read the docs, because this problem shouldn't be new. But i really don't know what to search for. i am populating a database (v7.4.1) with COPY. Some...
2
4802
by: Clodoaldo Pinto Neto | last post by:
Hi all, I'm trying to copy a table with a text field column containing a new line char to a file: ksDesenv=# create table page(line text) without oids; CREATE TABLE ksDesenv=# insert into...
2
2461
by: Marcin Zmyslowski | last post by:
Hello all! How to copy a table in MS SQL Server 2000 without chaning a structure? I mean, I have one table, which has autoincrement numeric field (ID). When I copy this table by exporting this...
2
3445
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have...
4
4960
by: Jim Devenish | last post by:
I wish to copy a table on a SQL Server backend to a table on an Access (.mdb) front end in the simplest way. I have the following to get the recordset but am seeking something easier. Dim...
9
15100
by: fniles | last post by:
I would like to copy a table(s) from SQL Server 2005 to a CVS file and vice versa. I was thinking to use the BCP command line utility, but I have a few questions: 1. The machine where I am...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.