i need to move records from one table to another within the same database from a one table structure to a 2 table structure.
tblcombinedinfo is imported from another database, it contains a FName, LName, Email, DistAdd1, DistAdd2, DistAdd3, DistFax, DistPh, GOAdd1, GOPh, GOFax. There is no autonumber (it wouldn’t match the new tables values anyway) therefore the only way to indentify these rows would be to use the LName, FName combination as a primary key.
the 4 DistAdd fields and the Dist phone and fax need to be appended to tblLegDistrictAdd. tblLegDistrictAdd was created upon the decision to split the name fields from the address fields and link by an autonumber in order to accommodate the possibility of more than one address. so the new tables are as follows:
tblLegislators
LegID – autonum
FName – text
LName – text
GORoomNo – text
GOPh – number
GOFax – number
GOBldgID – number SELECT DISTINCTROW [tblBuilding].[BldgID], [tblBuilding].[Bldg] FROM [tblBuilding];
tblLegDistrictAdd
DistAddID – autonum
LegID – number SELECT DISTINCTROW [tblLegislators].[LegID], [tblLegislators].[LName], [tblLegislators].[FName] FROM [tblLegislators] ORDER BY [LName];
DistAdd1-DistAdd4, DistAddPh, DistAddFax (phone and fax are number fields with imput masks)
I cannot write an append query that is netting me the proper results and i think it has to do with the last name and first name needing to both be the unique identifier. All the fields in tblcombinedinfo are textfields which means that the phone and fax numbers are probably stored as text with the dashes included. I appreciate any help with this one. and if that’s not enough, problem #2 is below.
There are some other things that need to be done with this data too. the GOAdd1 in tblcombinedinfo needs to be appended to tblLegislators.GORoomNo but only the first portion of the value stored in that field. (originally GOAdd1 had both a room number 3 digits long and a bldg number 3 letters long the numbers and letters are seperated by a space.) The new Field is GORoomNo and is simply the room number and the building is in another field as a lookup. I do not need to append the building.