A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

splitting up a table



 
 
Thread Tools Display Modes
  #1  
Old February 19th, 2009, 06:33 PM posted to microsoft.public.access.tablesdbdesign
triley01
external usenet poster
 
Posts: 1
Default splitting up a table

Hello,

I have imported a list from Excel with 25K records. Each row has Name
information (FN,LN,Co,Address,) plus Payment information (TransDate, Amount,
GL) If a person paid more than once their Name information is repeated with
the new Payment information. So the list contains many duplicate name entries.


From this table I would like to create a Name table that stores each unique
person only once and links to a Payments table which shows one or more
payments that each Name record has given.

How in Access can I accomplish this? Thanks so much for your help. Tim

  #2  
Old February 19th, 2009, 07:19 PM posted to microsoft.public.access.tablesdbdesign
Dale Fye
external usenet poster
 
Posts: 2,651
Default splitting up a table

Start out with a make table query. Select the fields FN, LN, Co, Address
and select the MakeTable query. It will ask for a table name, call it
tbl_People. In the query properties, select Unique Values, so the QUERY
looks like:

SELECT DISTINCT FN, LN, Co, Address
INTO tbl_People
FROM yourTable

Run the query to build tbl_People

Open tbl_People in design mode, and add a ID field, set to Autonumber
datatype. Access will immediately create numbers for the ID for each of the
unique FN, LN, Co, Address combinations. Close that table

Next, open the table that contains the names and payment info. Add a new
field to it PeopleID, and give it a long integer datatype (to match it up
with the datatype of the Autonumber field in the new table). Close that
table

Now, create a new update query that looks something like:

UPDATE yourTable as T INNER JOIN tbl_People as P
ON T.FN = P.FN
AND T.LN = P.LN
AND T.Co = P.Co
AND T.Address = P.Address
SET T.PeopleID = P.ID

Run this query.

At this point, you should have a PeopleID for each record in your original
table, and should be able to delete the LN, FN, Co, and Address columns from
that table.

HTH
Dale

SET yourTable.PeopleID = tbl_People.ID

"triley01" u49755@uwe wrote in message news:91f3ac954c6d4@uwe...
Hello,

I have imported a list from Excel with 25K records. Each row has Name
information (FN,LN,Co,Address,) plus Payment information (TransDate,
Amount,
GL) If a person paid more than once their Name information is repeated
with
the new Payment information. So the list contains many duplicate name
entries.


From this table I would like to create a Name table that stores each
unique
person only once and links to a Payments table which shows one or more
payments that each Name record has given.

How in Access can I accomplish this? Thanks so much for your help. Tim



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.