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

How to split a text string into 3 parts in Crystal Reports

Status
Not open for further replies.

bjez

MIS
Oct 8, 2003
2
US
Hi, I'm working in Crystal Reports 8 (SQL 7 is my database)and need help writing a formula field. I have a field {evaluations.level_path} of type String that contains information about an employee's reporting structure. It looks just like this:
"Department Name\Department AVP\Manager Name"

I need to extract each of the three parts of the string using the "\" as my delimiter. I tried using a Split but I can't get it to work. Any ideas on how to write this formula in Crystal? Thanks! Barb
 
Try each of the following for each part (the [X] is the subscript position of the string):

split("Department Name\Department AVP\Manager Name")[1]
split("Department Name\Department AVP\Manager Name")[2]
split("Department Name\Department AVP\Manager Name")[3]

Substitute your field after you understand how it works.

-k
 
Problem solved! Thanks for your help.
 
I think that you would actually want to tell it what the delimiter is otherwise " " is assumed.

split("Department Name\Department AVP\Manager Name", "\")[1]
split("Department Name\Department AVP\Manager Name", "\")[2]
split("Department Name\Department AVP\Manager Name", "\")[3]


~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top