I have created a report that lists fax numbers, but it's in all number format with no hyphens or anything. Ex.1234567891. I would like for it to add hyphen after the 3rd & 6th numbers. How can I do this?
@formatfax
stringvar fax:="1234567891";
left(fax,3)+"-"+mid(fax,4,3)+"-"+ right(fax,4);
Thanks for your reply however, I am getting an error. Here is what I have in the Crystal Reports Formula Editor:
@formatfax
stringvar fax:="{BUSINESS.FAXPHONE}";
left(fax,3)+"-"+mid(fax,4,3)+"-"+ right(fax,4);
all you have to do in the formula is:
left ({BUSINESS.FAXPHONE},3)+"-"+mid({BUSINESS.FAXPHONE},4,3)+"-"+right(
{BUSINESS.FAXPHONE},4);
(Or you can remove the double quotes in the first line.
stringvar fax:={BUSINESS.FAXPHONE};
You are getting the error because of that.)
If you are still having problems, please let me know.
I got it fixed before you replied:
// formatfax (Didn't Recognize the @ formatfax)
stringvar fax:={BUSINESS.FAXPHONE}; (I had "{BUSINESS.FAXPHONE}" Here. Didn't need " ")
left(fax,3)+"-"+mid(fax,4,3)+"-"+ right(fax,4);
Thanks for your help!