PC Review


Reply
Thread Tools Rate Thread

Copying data from one table into another

 
 
GD
Guest
Posts: n/a
 
      11th Jul 2007
Hello. I've checked around about this subject but can't seem to find
the information that helps my case of the problem, so here it is.

The overall goal is to move all the data from an old Q&A database to
the new Access database that I created. I exported the Q&A data into
a Database IV file, which I then imported into new Access database
file so it could be easily managed. Surprisingly enough to me, Access
neatly sorted the data into a new table with the correct fields
despite the fact that Q&A is more of a text sheet editor than a
database.

The goal now is to put all the old data (right now in table
[tblOldParts]) into the same table as my database [tblParts]. The
difficult part is how they vary with fields.

In my database tblParts has a child table, tblDimensions. However, in
the tblOldParts, since Q&A couldn't really have relationships, instead
of having child records, it has the fields #1 through #15, and #1Desc
- #15 Desc.

My question comes to this: How can I move (or copy) the data from
tblOldParts to tblParts, and somehow use the fields #1 - #15 to add to
the child table? Worst case scenario is I do it all manually.

I can post more information if it will help...hopefully this explains
enough about my situation to gather an understanding.

 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      11th Jul 2007
It sounds like you recognize that you'll need a one-to-many relationship to
get those Dimension data points related to the proper parts.

One approach would be to use a two-step conversion. The first step is
adding the Parts (and keeping track of which part is associated with which
{?NEW} PartID number) -- you may need to add a temporary field that will
store the OldPartID for each addition.

The second step is to build a query (actually 15 queries!) that joins the
new parts table to the old one on that OldPartID field, and returns the 1st
Dimension column. When this SELECT query is returning what you want, add in
the new PartID field, change the query to an Append query, and append to
your tblDimensions, using the new PartID and the 1st Dimension column. If
you need to know which Dimension column it came from, you'll need to have a
field in the new Dimension table to hold "1".

Repeat for the 2nd Dimension (with "2" in the extra field). Rinse and
repeat <g>!

Regards

Jeff Boyce
Microsoft Office/Access MVP

"GD" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello. I've checked around about this subject but can't seem to find
> the information that helps my case of the problem, so here it is.
>
> The overall goal is to move all the data from an old Q&A database to
> the new Access database that I created. I exported the Q&A data into
> a Database IV file, which I then imported into new Access database
> file so it could be easily managed. Surprisingly enough to me, Access
> neatly sorted the data into a new table with the correct fields
> despite the fact that Q&A is more of a text sheet editor than a
> database.
>
> The goal now is to put all the old data (right now in table
> [tblOldParts]) into the same table as my database [tblParts]. The
> difficult part is how they vary with fields.
>
> In my database tblParts has a child table, tblDimensions. However, in
> the tblOldParts, since Q&A couldn't really have relationships, instead
> of having child records, it has the fields #1 through #15, and #1Desc
> - #15 Desc.
>
> My question comes to this: How can I move (or copy) the data from
> tblOldParts to tblParts, and somehow use the fields #1 - #15 to add to
> the child table? Worst case scenario is I do it all manually.
>
> I can post more information if it will help...hopefully this explains
> enough about my situation to gather an understanding.
>



 
Reply With Quote
 
GD
Guest
Posts: n/a
 
      12th Jul 2007
On Jul 11, 10:39 am, "Jeff Boyce" <nonse...@nonsense.com> wrote:
> It sounds like you recognize that you'll need a one-to-many relationship to
> get those Dimension data points related to the proper parts.
>
> One approach would be to use a two-step conversion. The first step is
> adding the Parts (and keeping track of which part is associated with which
> {?NEW} PartID number) -- you may need to add a temporary field that will
> store the OldPartID for each addition.
>
> The second step is to build a query (actually 15 queries!) that joins the
> new parts table to the old one on that OldPartID field, and returns the 1st
> Dimension column. When this SELECT query is returning what you want, add in
> the new PartID field, change the query to an Append query, and append to
> your tblDimensions, using the new PartID and the 1st Dimension column. If
> you need to know which Dimension column it came from, you'll need to have a
> field in the new Dimension table to hold "1".
>
> Repeat for the 2nd Dimension (with "2" in the extra field). Rinse and
> repeat <g>!
>
> Regards
>
> Jeff Boyce
> Microsoft Office/Access MVP
>
> "GD" <gdo...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
> > Hello. I've checked around about this subject but can't seem to find
> > the information that helps my case of the problem, so here it is.

>
> > The overall goal is to move all the data from an old Q&A database to
> > the new Access database that I created. I exported the Q&A data into
> > a Database IV file, which I then imported into new Access database
> > file so it could be easily managed. Surprisingly enough to me, Access
> > neatly sorted the data into a new table with the correct fields
> > despite the fact that Q&A is more of a text sheet editor than a
> > database.

>
> > The goal now is to put all the old data (right now in table
> > [tblOldParts]) into the same table as my database [tblParts]. The
> > difficult part is how they vary with fields.

>
> > In my database tblParts has a child table, tblDimensions. However, in
> > the tblOldParts, since Q&A couldn't really have relationships, instead
> > of having child records, it has the fields #1 through #15, and #1Desc
> > - #15 Desc.

>
> > My question comes to this: How can I move (or copy) the data from
> > tblOldParts to tblParts, and somehow use the fields #1 - #15 to add to
> > the child table? Worst case scenario is I do it all manually.

>
> > I can post more information if it will help...hopefully this explains
> > enough about my situation to gather an understanding.


Thanks, Jeff. Worked great!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Copying data from one table to another Jeff Boyce Microsoft Access Queries 1 30th Jun 2008 04:09 PM
Copying data from one table to another bash Microsoft Access External Data 3 13th Feb 2008 06:27 PM
Copying data from one table to another?? =?Utf-8?B?Ymg=?= Microsoft Dot NET 0 20th Apr 2006 05:59 PM
Copying data to a new table Charles Phillips Microsoft Access Forms 2 6th Jan 2005 01:02 PM
copying data from one table to another Deepak Microsoft ADO .NET 1 5th Sep 2003 02:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:52 AM.