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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|