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 pull specific info from a string field? CR8.5

Status
Not open for further replies.

Digitalcandy

IS-IT--Management
May 15, 2003
230
US
I have a string field that is 25 characters maximum. This field has two items in it that I want to be able to seperate from each other. Examples are as follows;

1.06;5.98
10.45;20.55
.45;.89

Above I've shown 3 string examples of what the field could possibly look like. As you can see there are 2 data items seperated by a semicolon. The first item represents a price and the second represents a quantity. How can I seperate the two being that the two items are not always the same length but are always seperated by a semicolon?

TIA.
 
A little more clarity on the split() function would be very helpful.

Thanks.
 
Try:

whileprintingrecords;
strvar array MyValues := split({Table.Field},";")

Now you can reference them later using:

whileprintingrecords;
strvar array MyValues;

MyValues[1] and MyValues[2]

-k
 
synapsevampire, thanks for the help but I'm not following your example.

I made a formula, {@Array} and the code is the following;

whileprintingrecords;
strvar array MyValues := split({Table.Field},";")


But it will not allow me to save it because it says, "The result of a formula cannot be an array".

I did not even try the "referencing" part you mentioned as I could not even figure out what is going on with the first part of your example.

BTW, I assumingly changed "strvar" to stringvar.
 
heres an example:

WhileprintingRecords;
Stringvar array Dons:=split("eron;lsdkfj;slkjf;",";");
dons[2];

This formula returns "lsdkfj"


Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top