cancel
Showing results for 
Search instead for 
Did you mean: 

Phone Formatting

Former Member
0 Kudos

We are a global company and quite often have different formats for our phone and fax numbers. What kind of formula do I need to create to properly format the phone number depending on a certain country?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You could try something similar in a formula:


select {country}

case "usa", "canada":
picture({phone#}, "(xxx) xxx-xxxx")

case "uk":
picture({phone #}, "xx-xx-xxxx-xx");

For USA & Canada, the phone number will display as (907) 123-4567. The number of digits in the phone number should match the number of x in the formula.

Former Member
0 Kudos

Would I have to do this in the SQL query? Or is there something I can do in a Crystal Report formula?

Former Member
0 Kudos

The code I suggested is for a Crystal Reports formula, I am assuming it can be done via a SQL query as well.

Former Member
0 Kudos

Thanks! That did exactly what I wanted it to. I have never done a formula like that before so I was confused. Thanks a lot for helping!

Answers (0)