Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with unique records

Status
Not open for further replies.

hansretallick

Technical User
Jan 9, 2006
33
0
0
GB
I have a database which imports from another one using ODBC. In my database,the contacts table shows every detail of a contact as one record. The import database uses two tables for contacts, one which shows name, address etc, and a second table which uses the same key as the main contacts one, and then lists Email, home phone, work phone, mobile phone as separate records.
I need the import to show information with one record per contact and the secondary contact information to be presented as Email, home phone, work phone, mobile phone columns in the same record as the other contact details.

Table 1
Key
Name
Address
Date of birth
etc

Table 2
Key (equates to key in Table 1)
Type "1,2,3 etc"
Name "Email, home phone, work phone, mobile phone etc"
Data "fred@hotmail.com, 020 8701 xxxx, etc"

I think I need to use the TOP command, but I'm not sure how to write the SQL.
I would appreciate any help I can get for this. The database is .mdb version Access 2010.

 
Hi,

Type "1,2,3 etc"
second table which uses the same key as the main contacts one, and then lists Email, home phone, work phone, mobile phone as separate records.

So which Type associates with what list items?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
1 = Email, 2 = Home phone, 3 = Work phone, 4 = Mobile phone
Although this secondary table potentially could list any number of contact details (that was the thinking behind using a separate table) I only want to import the first four types of contact

Thanks

Hans
 
I would link to the tables from the source and create a crosstab from Table 1 and Table 2. Set Key, Name, Address, Date of birth, etc as the Row Headings, Type as the Column Heading, and First of Data as the value.

Append this to your target table.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top