Multiple phone numbers (home, business, mobile) in one list

  • Thread starter Russ via AccessMonster.com
  • Start date
R

Russ via AccessMonster.com

Need help trying to figure out how to make a 2 field query showing multiple
phone numbers (home, business, mobile) with the contact ID in the second
field
Example
home# , Contact ID 3
Mobile# , Contact ID 3
Fax# , Contact ID 3
Any ideas?
 
R

Russ via AccessMonster.com

Can anyone help? I need a two list query one being the phone numbers
(different fields, like home, buisness and mobile) and the other the contact
ID
 
R

Russ via AccessMonster.com

Can anyone help?
Can anyone help? I need a two list query one being the phone numbers
(different fields, like home, buisness and mobile) and the other the contact
ID
Need help trying to figure out how to make a 2 field query showing multiple
phone numbers (home, business, mobile) with the contact ID in the second
[quoted text clipped - 4 lines]
Fax# , Contact ID 3
Any ideas?
 
J

Jeff Boyce

Russ

That will really depend on how your data is organized. Queries run against
data in tables (or in other queries).

Jeff Boyce
<Access MVP>

Russ via AccessMonster.com said:
Can anyone help?
Can anyone help? I need a two list query one being the phone numbers
(different fields, like home, buisness and mobile) and the other the
contact
ID
Need help trying to figure out how to make a 2 field query showing
multiple
phone numbers (home, business, mobile) with the contact ID in the second
[quoted text clipped - 4 lines]
Fax# , Contact ID 3
Any ideas?
 
R

Russ via AccessMonster.com

Jeff,
I have a contact table, with the following fields, Contact ID, Home Phone,
Office Phone, Mobile Phone
What I need is a Query with two columns 1 = contact ID and 2nd being the
phone number (sum of all types home, office and mobile)
example
Contact ID Phone
3 111-1111 (home)
3 111-1112 (office)
3 111-1113 (mobile)
Hope this helps.
Russ


Jeff said:
Russ

That will really depend on how your data is organized. Queries run against
data in tables (or in other queries).

Jeff Boyce
Can anyone help?
[quoted text clipped - 9 lines]
 
J

Jeff Boyce

Russ

As a work-around, consider using a UNION query, built up from three queries.
One gets ID & HomePhone, one gets ID & OfficePhone, and the third gets ID &
MobilePhone.

I say this is a work-around because you could get all three in a single
query if your table structure was something like:

tblWhatever
WhateverID
PhoneNumber
PhoneType (i.e., home, office, mobile, toll-free, TTY, etc.)

Regards

Jeff Boyce
<Access MVP>

Russ via AccessMonster.com said:
Jeff,
I have a contact table, with the following fields, Contact ID, Home Phone,
Office Phone, Mobile Phone
What I need is a Query with two columns 1 = contact ID and 2nd being the
phone number (sum of all types home, office and mobile)
example
Contact ID Phone
3 111-1111 (home)
3 111-1112 (office)
3 111-1113 (mobile)
Hope this helps.
Russ


Jeff said:
Russ

That will really depend on how your data is organized. Queries run
against
data in tables (or in other queries).

Jeff Boyce
Can anyone help?
[quoted text clipped - 9 lines]
Fax# , Contact ID 3
Any ideas?
 
R

Russ via AccessMonster.com

Jeff, thanks!
Are you saying that I did the table wrong by having each phone in it's own
field?
Should there be a details table, is that what you are saying?
Just trying to understand...

Jeff said:
Russ

As a work-around, consider using a UNION query, built up from three queries.
One gets ID & HomePhone, one gets ID & OfficePhone, and the third gets ID &
MobilePhone.

I say this is a work-around because you could get all three in a single
query if your table structure was something like:

tblWhatever
WhateverID
PhoneNumber
PhoneType (i.e., home, office, mobile, toll-free, TTY, etc.)

Regards

Jeff Boyce
Jeff,
I have a contact table, with the following fields, Contact ID, Home Phone,
[quoted text clipped - 23 lines]
 
R

Russ via AccessMonster.com

Ok, just figured out I have no idea how to make a union query, can you help
get me started?

Jeff said:
Russ

As a work-around, consider using a UNION query, built up from three queries.
One gets ID & HomePhone, one gets ID & OfficePhone, and the third gets ID &
MobilePhone.

I say this is a work-around because you could get all three in a single
query if your table structure was something like:

tblWhatever
WhateverID
PhoneNumber
PhoneType (i.e., home, office, mobile, toll-free, TTY, etc.)

Regards

Jeff Boyce
Jeff,
I have a contact table, with the following fields, Contact ID, Home Phone,
[quoted text clipped - 23 lines]
 
J

Jeff Boyce

Russ

If one person can have zero, one or many phone numbers, the "theoretical"
way to handle a one-to-many is to use a "child" table. If you elect to use
repeating columns (e.g., phonetype1, phonetype2, phonetype3), you'll need
some way to put those back together as a "phonenumber". That's where the
UNION query comes in.

Regards

Jeff Boyce
<Access MVP>

Russ via AccessMonster.com said:
Jeff, thanks!
Are you saying that I did the table wrong by having each phone in it's own
field?
Should there be a details table, is that what you are saying?
Just trying to understand...

Jeff said:
Russ

As a work-around, consider using a UNION query, built up from three
queries.
One gets ID & HomePhone, one gets ID & OfficePhone, and the third gets ID
&
MobilePhone.

I say this is a work-around because you could get all three in a single
query if your table structure was something like:

tblWhatever
WhateverID
PhoneNumber
PhoneType (i.e., home, office, mobile, toll-free, TTY, etc.)

Regards

Jeff Boyce
Jeff,
I have a contact table, with the following fields, Contact ID, Home
Phone,
[quoted text clipped - 23 lines]
Fax# , Contact ID 3
Any ideas?
 
J

Jeff Boyce

Russ

Check Access HELP for more details.

Generically, create three queries (one for each field - see my earlier
post).

Then use the SQL from each and start a new query without any tables (select
the SQL view in design mode). Put each of your three query's SQL into the
new one, separated by UNION. For example (your syntax may vary):

SELECT a, x
FROM YourTable
UNION
SELECT a, y
FROM YourTable
UNION
SELEZCT a, z
FROM YourTable;

Regards

Jeff Boyce
<Access MVP>

Russ via AccessMonster.com said:
Ok, just figured out I have no idea how to make a union query, can you
help
get me started?

Jeff said:
Russ

As a work-around, consider using a UNION query, built up from three
queries.
One gets ID & HomePhone, one gets ID & OfficePhone, and the third gets ID
&
MobilePhone.

I say this is a work-around because you could get all three in a single
query if your table structure was something like:

tblWhatever
WhateverID
PhoneNumber
PhoneType (i.e., home, office, mobile, toll-free, TTY, etc.)

Regards

Jeff Boyce
Jeff,
I have a contact table, with the following fields, Contact ID, Home
Phone,
[quoted text clipped - 23 lines]
Fax# , Contact ID 3
Any ideas?
 
R

Russ via AccessMonster.com

Jeff,

Wow, now that is cool! Worked great...
Thanks, this was a great learning experience!


Jeff said:
Russ

Check Access HELP for more details.

Generically, create three queries (one for each field - see my earlier
post).

Then use the SQL from each and start a new query without any tables (select
the SQL view in design mode). Put each of your three query's SQL into the
new one, separated by UNION. For example (your syntax may vary):

SELECT a, x
FROM YourTable
UNION
SELECT a, y
FROM YourTable
UNION
SELEZCT a, z
FROM YourTable;

Regards

Jeff Boyce
Ok, just figured out I have no idea how to make a union query, can you
help
[quoted text clipped - 27 lines]
 
Top