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!

Underscores ignored in selection formula string

Status
Not open for further replies.

systechusa

IS-IT--Management
Apr 27, 2011
3
Hello -

I have created the following selection formula:

not ({RESULTS.ANALYSIS} startswith ["$S_", "S_"])

The reason I have created this formula is because I want to exclude such values as "$S_QUECHERS" and "S_NICOTINE".

The problem is, when I run the report, such values as "$SCREEN_LCMSMS" and "SUGAR" are also excluded, even though they do not start with "$S_" or "S_".

I would appreciate any help. Thank you in advance!
 
Hi,
Depending on the database, the _ character can be interpreted as a wild card ( for a single character while * is for a string of chars) - that could cause the result you are seeing.

What database is involved?


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thank you very much for the reply. We are using a SQL2000 database, and it certainly does seem as though the underscore is being treated as a wildcard. I really hope there is an easy workaround available... Do you have any suggestions?
 
You could create a formula {@analysis} like this:

if {RESULTS.ANALYSIS} startswith ["$S_", "S_"] then
"^" else
{RESULTS.ANALYSIS}

Then use a record selection formula like this:

{@analysis} <> "^"

-LB

 
Thank you lbass! That was embarrassingly simple, and it saved me a lot of grief ;) Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top