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

Like operator not working correctly

Status
Not open for further replies.

julsails

IS-IT--Management
May 31, 2001
5
US
I have included the LIKE operator in my selection criteria. The problem is it doesn't seem to be working. As an example, LIKE for the IPAdress of 127.* gives me 110.2.1.1.

Can anyone tell me what I am doing wrong? Here is my selection criteria. I am using Crystal7.


{CV3EnumReference.ColumnName} = "AuditType" and
{CV3EnumReference.ReferenceString} = {?AuditType} and
{SCMLogonAudit.CreatedWhen} >= {?Start Date and Time} and
{SCMLogonAudit.CreatedWhen}<={?End Date and Time} and
if {?Workstation} = &quot;All&quot; then true
else
{SCMLogonAudit.Workstation} like {?Workstation}
and
if {?User} = &quot;All&quot; then true
else
{SCMLogonAudit.Username} like {?User}
and
if {?IPAddress} = &quot;All&quot; then true
else
{SCMLogonAudit.IPAddress} like {?IPAddress}
 
It looks to me like you are struggling on something we were having difficulty with a while back. Below is a copy of Crystal's help on IF-->THEN-->ELSE clauses with multiple conditions.

The If-Then-Else operator can be used to create powerful multi-condition formulas.
Multi-condition and nested If-Then-Else formulas can be set up in this general pattern:

If the X (first) condition is met, Then, go to the Y (second) condition.
If the Y condition is met, Then perform the Y action.
If the Y condition is not met (Else), perform the Y alternative.
If the X condition is not met (Else), perform the X alternative. Thus:

If {file.FIELD1} = &quot;X&quot; Then
If {file.FIELD2} = &quot;Y&quot; Then
&quot;Y Action&quot;
Else
&quot;Y Alternative&quot;
Else
&quot;X Alternative&quot;

See How to create If-Then-Else formulas.
This formula checks the field FIELD1 first.

If the value of that field is &quot;X,&quot; the FIELD2 field is checked.

If the value of that field is &quot;Y,&quot; then &quot;Y Action&quot; is printed.

If the value of FIELD2 is not &quot;Y,&quot; then &quot;Y Alternative&quot; is printed.

If the value of FIELD1 is not &quot;X,&quot; then &quot;X Alternative&quot; is printed.

While multi-condition formulas look complex at first, after you have worked through one or two you will find that they are not as intimidating as they seem, especially considering their usefulness.
 
Thanks so much. I think I have it working properly now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top