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!

NOT LIKE WILDCARD

Status
Not open for further replies.

APB1981

Technical User
Jul 10, 2005
83
NO
Hi guys,

I need a quick bit of assistance here::)

I know how to create a normal wildcard parameter:

uppercase ({Table.name}) LIKE "*"& uppercase({?Param name})&"*"


But I want be able to also create a not like parameter <> LIKE.

if the user enters John - then the only data that will be shown is where john is not in the string (any where in the string).

Any ideas it must be possible in a roundabout kind of way.


Thanks in advance.

AB

APB
 
You almost had it:

NOT(uppercase ({Table.name}) LIKE "*"& uppercase({?Param name})&"*")

-k
 
Hi SV,

Okay I'll give it a crack! Thanks again for your speedy delivery. You guys are what makes Tek-tips the best source of Crystal help on the web!!

AB

APB
 
Thanks SV,

It worked nicely. Just for anyone interested - this is the reason I wanted that particular formula::)

I have a normal filter (parameter) if the user enters '**' then the text in the parameter following the '**' be an an exclusion in the query (not a normal select query). Other wise without the ** the parameter would be a normal select query.

Example: If I enter '**test'
then the report will not include items with 'test' in the string.

Example: If I enter 'test'
then the report will include all items with 'test' in the string.

Here is some of my coding:

//formula 1.) {@** Check}
// if (Left({?parameter}, 2)) = '**' then -1 else 0


//formula 2.) {@** action}
//if {?parameter} <> "" and len({?parameter}) >= 2 then uppercase //(right(ToText //({?parameter}),len(ToText ({?parameter}))-2))


(
if {?parameter} <> "" and {@** Check} = -1 then isnull ({Table.Name}) or NOT (uppercase ({Table.Name}) LIKE "*"& {@** action}&"*")
else
if {?parameter} <> "" and {@** Check} = 0 then uppercase ({Table.Name}) LIKE "*"& uppercase({?parameter})&"*"
else
if {?parameter} = "" then true
)


APB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top