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

Question regarding "replace()"

Status
Not open for further replies.

jj1576

MIS
May 21, 2008
69
US
Hi,

I'm trying to use the replace function to omit the phrase "barcode not scanned" from the testresults.memo field. I'm sure I'm misunderstanding the replace function, but I am using the formula

replace({TestResults.Memo},"barcode not scanned", "")

and nothing happens.

The field sometimes contains just the above phrase, but other times contains additional text. In every case, I just want "barcode not scanned" to disappear. Is anyone familiar with this function? Thanks in advance,

jj
 
I'm guessing that you should put the formula in your report, not the Memo Field? Crystal can't replace test in your database. Is that what you were thinking it would do?


DataDog [pc2]
If God wanted us to count in Hexadecimal, then why did he only give us A fingers?
 
DataDog,

Thanks for the response. I'm using the formula in the report in place of the testresults.memo field, so the formula is actually in the details section of the report.

It formula still displays the contents of the testresults.memo field, it just doesn't replace the "barcode not scanned" portion with
 
Looking at the help doc it looks like the replace function is case sensitive....

Replace
Basic and Crystal syntax.

Overloads
Replace (inputString, findString, replaceString)
Replace (inputString, findString, replaceString, startPosition)
Replace (inputString, findString, replaceString, startPosition, count)
Replace (inputString, findString, replaceString, startPosition, count, compare)
Arguments
inputString is a String containing substring to replace.
findString is a substring being searched for.
replaceString is the replacement substring.
startPosition is an optional Number indicating the position within inputString where substring search is to begin. If omitted, 1 is assumed.
count is an optional Number of substring substitutions to perform. If omitted, the default value is -1, which means make all possible substitutions.
compare is an optional Number indicating the kind of comparison to use when evaluating substrings:
0 performs a comparison that is case-sensitive
1 performs a comparison that is case-insensitive
If omitted, a case-sensitive comparison is performed.

possibly you need..."Barcode Not Scanned"? I'm really hacking here...

DataDog [pc2]
If God wanted us to count in Hexadecimal, then why did he only give us A fingers?
 
Is there a case issue? Try:

replace(ucase({table.memo}), "BARCODE NOT SCANNED","")

-LB
 
Case was the issue- thanks a bunch to both of you... would have been a while before I figured that one out.

Cheers,

JJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top