• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

Reformat phone number in Crystal Reports to xxx-xxx-xxx

I need to convert the phone number field from (xxx)xxx-xxxx to xxx-xxx-xxxx in Crystal Reports
0
kvrogers
Asked:
kvrogers
  • 2
1 Solution
 
mlmccCommented:
Is the phone number a text field?
If so use Replace

FOrmula to do it

Local StringVar PhoneNumber;
PhoneNumber := {PhoneNumberFIeld];
PhoneNumber := Replace(PhoneNumber,'(','');
PhoneNumber := Replace(PhoneNumber,')','-');
PhoneNumber

Open in new window


In a single line

Replace(Replace({PhoneNumberField},'(',''),')','-')

mlmcc
0
 
kvrogersAuthor Commented:
The phone number appears as (618)123-4567   I need it to show  618-123-4567
0
 
kvrogersAuthor Commented:
THANK YOU VERY MUCH.  The REPLACE formula worked.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now