John W. Colby
jwcolby at colbyconsulting.com
Tue Apr 20 19:38:23 CDT 2004
ditto. add the pk to the original. then in the new tables add the pk of the original table as a fk in the new table. this "points back" to what record it came from. POC John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of William Hindman Sent: Tuesday, April 20, 2004 4:42 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Create Junction Table From Existing Data ...I know of no simple way to do this ...my approach has always been to add an ANPK to the original table and then to use that as the control to populate the derivative tables through a series of queries ...but the circumstances change so much from mdb to mdb that I've never been able to write code that ever worked for more than one situation. William Hindman "Always code as if the person who is maintaining or testing your code is a violent psychopath who knows where you live." William Silverstein ----- Original Message ----- From: "Mitsules, Mark S. (Newport News)" <Mark.Mitsules at ngc.com> To: "'[AccessD]'" <AccessD at databaseadvisors.com> Sent: Tuesday, April 20, 2004 4:23 PM Subject: [AccessD] Create Junction Table From Existing Data > Group, > > Is there a method to create a junction table from a non-normalized table? I > inherited a table that I now need to normalize into two primary tables and a > joining junction table. The primary tables were easy enough to create, but > how can I create the junction table? > > I want to take a records such as: > Fld1 Fld2 Fld3 Fld4 Fld5 <=Fields > Dat1 Fld2 Fld4 Fld5 <=Record > Dat2 Fld3 Fld4 <=Record > > And turn it into: > Fld1 FldID <=Fields > Dat1 Fld2 <=Record > Dat1 Fld4 <=Record > Dat1 Fld5 <=Record > Dat2 Fld3 <=Record > Dat2 Fld4 <=Record > > > Mark > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com