How to append 1 table into 2

  • Thread starter diablowrym via AccessMonster.com
  • Start date
D

diablowrym via AccessMonster.com

Hi Folks,
Need help once again. I ‘m trying to create a new db from one that someone
else did. The old db only had one table (cry). The fields are:

ID –PK (autonumber)
Box Number
Destruction Date
Client Record Number
Record Type
First Name
Last Name
DOB
Closed Date

So they would enter all the info for each folder and 20 folders would go in a
box. Hence 20 of the same box number, destruction date, record type.

New db has two tables:

tblBox has fields:

Box_Number - PK (assigned unique)
Destruction_Date
Record_Type

tblClient has fields:

ClientID – PK (autonumber)
Box_Number – FK
Client_Record_Number
Last_Name
First_Name
DOB
Closed_Date


My question is there any way to append the old db table into the new db
tables? That way there is only 1 box number, destruction date, record type
and the 20 client info are attached to it.

Thanks in advance.
Point.
 
K

KARL DEWEY

Try these queries --
INSERT INTO tblBox (Box_Number, Destruction_Date, Record_Type )
SELECT [OldTable].[Box Number], [OldTable].[Destruction Date],
[OldTable].[Record Type]
FROM [OldTable]
GROUP BY [OldTable].[Box Number], [OldTable].[Destruction Date],
[OldTable].[Record Type];

INSERT INTO tblClient (Box_Number, Client_Record_Number, Last_Name,
First_Name, DOB, Closed_Date )
SELECT [OldTable].[Box Number], [OldTable].[Client Record Number],
[OldTable].[Last Name], [OldTable].[First Name], [OldTable].[DOB],
[OldTable].[Closed Date]
FROM [OldTable];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top