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

Crystal Reports - Parsing Text/Memo Field

Status
Not open for further replies.

erp84

IS-IT--Management
Mar 11, 2013
35
US
One of my fields is a memo field that contains 3-20+ lines. I'm trying to break each line out into it's own record, so far what I have done is created 20 formulas such as: "Split( {codet.optdisp}, Chr(13) )[3]"

I don't need the first two lines so I started with the third. This works fine but since I've added 20 and not all records will have 20 lines in the text field it errors out when it hits a record as such.

I'm sure there is a better way to handle this, just experienced with parsing text. Suggestions?
 
In your formula you need to check to ensure that the field has the item you need.
Something like:

IF Ubound(Split( {codet.optdisp}, Chr(13) )) > 3
then Split( {codet.optdisp}, Chr(13) )[3] else ""

increasing the '3' up for each formula created 'record'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top