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

query help!

Status
Not open for further replies.

DenItech

IS-IT--Management
Mar 3, 2003
4
US
I have 2 tables which is a one-to-many relationship. In the first table it has the name of clients. On the second table it has multiple phone numbers of that certain client. The table is link by a nameid in both table.

How can i get those information into one table. With the format (Client's name, Phone1, phone2, phone3, phone4)?

any help with the query woulb be nice

thank you
 
You don't.

Simply create a query that uses inner join on clients name.

Something like this....

Select tblPhone.Phone, tblClient.clientID, tblClient.ClientName from tblClient innerjoin tblPhone.ClientID = tblClient.ClientID


Tyrone Lumley
augerinn@gte.net


 
I have already tried this. This query list duplicate record of the clients name with the multiple telephone numbers. I want the the name and phone numbers to be on the same record.

ex: (name, phone1, phone2, phone3, phone4)

thanx for the reply
 
To do this, you would have to write a program. You could use a crosstab query if the sets of phone numbers had similar fields.
 
Hmmm... You think in order to accomplish this i need to write a pragram with if statements?

I thought there was a simpler way to do this. Anyone else have any suggestions?
 
No, there is no simple way to do this. You are essentially asking it to dynamically create a number of columns. And populate those from various records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top