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

Split Memo Field Into Multiple Columns

Status
Not open for further replies.

peterenman

IS-IT--Management
Feb 1, 2010
7
CA
I hope someone can help me with this little mind bender. I have a report in which I'm trying to split a memo field into different sections based on a Hard Return. Example of Data in feild:

1st section of information
More info
More info

2nd section of Information
More info
More info

I want the 1st section of information and the 2nd section of information in columns side by side, which I was able to do by using an array to split it up. But the problem is that sometimes there isn't a second information section and therefore it gives me an error saying "String length is less than 0 or not an integer". So I figure I need to stipulate somehow that the array is dynamic? It would be fantastic if someone could help me out with this it.

Thanks,
Peter
 
Please show the content of your formula. If you are using the split function, you can use an introductory clause when referencing elements of the array like this:

stringvar array x := split({table.memo},chr(13));
if ubound(x) >= 2 then
x[2]

-LB
 
I was able to use that and it worked to a certain degree. I now have two formulas placed side by side to give the column effect. I would much rather have one formula that separates the two sections into columns.

The first formula:
split({X_T_ACTION.T_ACTION},chr(10)+chr(13))[1]

The second formula:
stringvar array x := split({X_T_ACTION.T_ACTION},chr(10)+chr(13));
if ubound(x) >= 2 then
x[2]

Any ideas on how I can streamline this a little more?

Peter
 
You can't create columns by formula. I suppose you could replace the return/line feed characters with tabs or spaces, but the results would probably not align the way you want.

-LB
 
Ok. That's fair enough. I can live with the way it is now. I appreciate your help.

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top