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!

Selecting part of a string for parameter 3

Status
Not open for further replies.

strom99

MIS
Nov 28, 2000
126
US
Hi

Need some help here, trying to set a parameter based on a product field, where the user can type in the product number (i.e. FC-104) which is contained in a 255 Character String. Anybody have any ideas?

Thanks
X-)
 
OK here is an example of my field

'XX(TM) XXXXX XXXXX(TM) XXXXXX XXXX XXXXXXX XXXX FC-786F'
OR
'XX(TM) XXXXXXXX(TM) XXXXXX XXXXXXX S15'

When the user is prompted they need to be able to type in 'FC-786F' or 'S15' and bring up the entire field. All the fields are of different lengths with the product ID (FC-786F) being quite different also, but always at the end of the field. Is this possible.

Thanks for the help.
 
The InStr function is probably what you want to look at. I think Ken was trying to find out what version number of SCR you have, because the InStr function is not present in all versions.
For faster, more precise answers, at least include your version number. Malcolm
Remember, if it wasn't for electricity, we'd be surfing the net by candlelight.
 
What build?
Just kidding - that's not nearly as challenging as someone using v2. The InStr function will tell you where the first occurance of the first character of a search string occurs in a target string. If result is 1 or greater, then the search string is in the target string. Malcolm
Remember, if it wasn't for electricity, we'd be surfing the net by candlelight.
 
You can use the "mid, left, or right" formulas based on where in the string the part of data you want is
 
The only problem with InStr is that you might find a match in the middle of the string. To just check the end I would use Right:

Right({field}, Length({?Param})) = {?Param} Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Strom99: As you have v8 you also have the InStrRev function - does exactly what you want - searches the string from other end i.e. S15 would return 3 David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top