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!

FIND specific data in a String Field 2

Status
Not open for further replies.

CrystalDuck

Programmer
Feb 2, 2005
16
US
I am working with Crystal 9.0 with a SQL 2000 database.

In my report, I need to display the data from a certain string field, but only up to a certain level.

Example:

"The quick brown fox jumped over the lazy dog.~~Hey Diddle Diddle, the cat and the fiddle..."

Okay, now...I only want to see the data up to the "~~"
So on the report I should only see:
"The quick brown fox jumped over the lazy dog."

This should involve INSTR() some how? But in MS Excel there is a FIND() function to look for the "~~" I just don't know the Crystal function.
Can anyone help?

Thanks a million in advance!!

Sincerely,
CrystalDuck
 
You could use:

left({table.string}, instr({table.string},"~~")-1)

Or if there is always a "~~" in the string:

split({table.string},"~~")[1]

-LB
 
Thank you so much...I knew it had to be that simple. Sorry I had to bug you for something so miniscule. :~/


Thank you,
CrystalDuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top