INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Problem with unique records

Problem with unique records

(OP)
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.

RE: Problem with unique records

Hi,

Quote:

Type "1,2,3 etc"

Quote:

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,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Problem with unique records

(OP)
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

RE: Problem with unique records

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close