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

CR9 Format Phone number 1

Status
Not open for further replies.

kimtp

Programmer
Jun 15, 2002
310
0
0
US
I have a field and want to format it to (###) ###-####. My program transfer data from one .mdb to another .mdb so I can not account for the formatting in the source .mdb only the target .mdb. Sometimes the source table is blank, sometimes it has a 0 if no number is known. In any case the output is 5551234567.

Have tried many things but can not figure out how to format the output like the properties box in data reports for VB.

Any help is appreciated

Kim
 
You can use crystal's function

picture({vw_name.fieldname},"(XXX)XXX-XXXX")

You can also put in to an if else statement and then based on the len of your source field do a different format.

Hope this helps...

 
Or if it's a numeric, try:

picture(totext(1234567890,0,""),"(XXX)XXX-XXXX")

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top