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

Isolate the 4,5 and 6 digit in phone number 3

Status
Not open for further replies.

noslo

Programmer
Dec 10, 2001
24
0
0
US
Hello All,

This is probably pretty easy but I am stuck because I haven't used Crystal Reports in a while. I am using CR8

I am trying to create a field from a phone number field displaying the 4, 5 and 6th digit in a phone number.

Ex:[PhoneNumber] = 3135551212 New Field = 555

How can I code this?

Thanks for your patience and help.

Helen
 
If this is a text field, use the following:

{fieldname}[4 to 6]

If it is a number use this:

Totext({Fieldname},0,"")[4 to 6] Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Dear Noslo,

Since it always good to have an alternative:

Mid({Table.PhoneNumber},4,6)

or if text:

Mid(Totext({Table.PhoneNumber}),4,6)

I use the mid function a lot and find it useful.

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Oops,

That should have been If number! So the first one works for text and the second formula is for numberfields.

Sorry,

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top