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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reorganize data

Status
Not open for further replies.

ttuser4

MIS
Jun 19, 2008
147
0
0
CA
I have one table, PEOPLE, with names
id nameLast nameFirst
000003 Sherwood Hugh
000004 Walter Wolfgang - 01
000005 McFadden Bruce - 01
000006 Power Des

another table, TELE_LINK, with phone numbers and emails
idPerson idTeleType useAreaCodeFormat numberOrAddress
000003 01 -1 2505463008
000003 03 -1 2505425276
000011 01 -1 2062921428
000011 02 -1 2062921426
000012 01 -1 6048829663
000012 02 -1 6048829669

idfTeleType represents what type it is - home phone, office phone, fax, email, etc.

I need to make a query which would show all phones and email in one row for one each person -
First Name Last Name Company Phone Home Phone Other Phone Mobile Fax Email
and put NULL or empty cell if record (tel. number or email) doesn't exist

I tried to do it for emails (TELE_LINK.idTeleType="10") only but is only shows records if email exists

SELECT PEOPLE.nameLast, PEOPLE.nameFirst, TELE_LINK.numberOrAddress
FROM TELE_LINK RIGHT JOIN PEOPLE ON TELE_LINK.idPerson = PEOPLE.id
WHERE (((TELE_LINK.idTeleType)="10"));

any idea please?
 
Try a crosstab query based on a join between the tables. I expect you might want to add the lookup table for TeleType. The last and first names would be the Row Headings, TeleType is the Column Heading, and First of NumberOrAddress for the value.

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

Part and Inventory Search

Sponsor

Back
Top