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

Memo Fields

Status
Not open for further replies.

codrutza

Technical User
Mar 31, 2002
357
IE
This could be a dummy question, but I want to be sure
If I have a memo field like which prints for example for a record
aaa bbb ccccc
is there a way to extract form it aaa, bbb, ccccc in separate fields?
Thank you very much
 
Sure, depending upon your version of Crysta, the database used, and how the data is stored within the memo field.

If this surprises you, please understand that software versions change functionality, and that work should be performed on the database whenever possible for optimal performance.

This mean, please post:

Crystal version
Databsae/connectivty used
Example data
Expected output

A means to extract from a memo field what is between spaces would be to use an array and the Split Function, as in:

strangvar array MyArray := split({table.field}," ");
MyArray[1]

This would return the first instance.

Another means is to use the INSTR function, as in:

if instr("AAA BBB CCC","AAA") > 0 then
"AAA exists"

If you're using CR 8.X or below, the above won't work and you'll need to use SQL Expressions or some database objects.

-k

 
Thank you, I'll try that
I am using CRvXI on a SQL Server Database/OLE db
and an example would be
"xcs3400 487 cartoons"
and I want to print
"xcs3400" "487" "cartoons
 
The split function works, thank you very much

But now I am trying this

stringvar array MyArray := split({table.field}," ");
MyArray[1]

data are

Xbd22568 20ft speakers 200cartons 2430kgs

and when I put the formula in the report it shows me Xbd22568

but the first time when I refresh the report I get
"An Array dimension must be an integer between 1 and 1000"

I have no idea what is this. Can you help?

Thank you very much


 
ok, I took this answer from business object

Err Msg: "An array's dimension must be an integer between 1 and 1000."
The information in the article refers to:
Crystal Reports 9

Applies to:

Reported version and higher
XIRR function
Array limits


Synopsis

In Crystal Reports (CR) 9 and higher, a formula uses the XIRR function to calculate internal rates of return. On the first page of the report the formula works correctly but after navigating through several pages of the report the following error message appears:

"An array's dimension must be an integer between 1 and 1000."

Why does this error message appear?

Solution

This error occurs because one of the XIRR function arguments is an array. Arrays in CR can contain a maximum of 1000 elements. The formula works correctly on the first few pages but when it gets to the page that contains the 1001st element, the error message appears



I don't know if the instr function applyes to my case
 
My guess is that you have some null memo fields. You also might need to allow for variation in the number of elements in the field. Try the following, e.g., for the second array element:

stringvar array MyArray := split({table.field}," ");

if isnull({table.field}) or
trim({table.field}) = "" then "No Memo" else
if ubound(MyArray) >= 2 then
MyArray[2]

-LB
 
hi, thanks for your reply
I tryed that and I still get the message
"An array's dimension must be an integer between 1 and 1000."
 
Please copy your exact formula into a post.

-LB
 
Thank you all
Sorry for this late reply
I just managed to combine the ideas, I don't know why I didn't think sooner.I didn't work with memo fields before and they scared me...!!! I used this for string type and I was sure I can't use it for memos, but now I tryed
I just tell to the input data operators to use a specific character when the field must be splited, like /
and then teh formula I use is
mid({field},1,Instr({field},"/")-1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top