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

Listing Phone Number Formula Needed

Status
Not open for further replies.

kernal

Technical User
Feb 27, 2001
415
US
I'm using crystal 8 with a csv file. I hope this is worded so it makes sense.

csv file

id home_phone work_phone cell_phone preferred_phone
1 444-4444 233-5555 555-5555 555-5555
2 222-4444 555-6555 222-4444
3 333-3333 333-3333

========

1. If there is a preferred phone # then I need to have the preferred phone # listed as the first # and also the type that the preferred phone # matches (will always match one of the types). Also, if one of the other phone #s are different then list those #s too.

2. If there is no preferred phone # then list HOME, WORK, CELL. If one of those #s are the same then just list the phone # once.

id
1 PREFERRED (CELL) 555-5555, HOME 444-4444, WORK 233-5555
2 PREFERRED (HOME) 222-4444, CELL 555-6555
3 HOME 333-3333

Thanks for any help you can give me.
 
I decided to change the way I'm going to list the phone #s. I don't care if the preferred # is the first # in the list. I'm just going to have an "*" next to the type that is the preferred #.

I still would like to know if there is a way to list a phone # once if that same phone # are different phone types:

csv file:

id home_phone work_phone cell_phone
3 333-3333 333-3333
4 444-4444 444-4444

results wanted:

3 HOME 333-3333
4 WORK 444-4444

Thanks
 
On the basis of your first post, I'd have thought you could build up the correct display as follows. For each of the three types, have something like
Code:
if isnull({ home_phone}) or {home_phone} = ""
then ""
else 
if not isnull({preferred_phone})
and {home_phone} = {preferred_phone}
then "PREFERRED (HOME) " & {home_phone}
else "HOME " & {home_phone}
Do the same for the others, then string the formula fields together in another linking field, which is what will actually display.
The second post, I don't follow.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc. It's working. Just ignore the second post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top