Print Page | Close Window

How do you use NOT LIKE with multiple not likes?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10069
Printed Date: 28 Apr 2024 at 7:20am


Topic: How do you use NOT LIKE with multiple not likes?
Posted By: icheckout
Subject: How do you use NOT LIKE with multiple not likes?
Date Posted: 20 May 2010 at 10:31am

Thank you for looking at my post.

I am creating a report that excludes certain domain names. I have several domains now and will be adding additional excluded domain names in the future.
 
I can get the select statement to work by entering a line for each domain name.  Here is what I use now (works correctly):
 
NOT ({DomainAddress} LIKE "DELL*") AND
NOT ({DomainAddress} LIKE "YAHOO*") AND
NOT ({DomainAddress} LIKE "APPLE*")
 
But it seams that you should be able to use something like (this example does not work):
 
NOT ({DomainAddress} LIKE "DELL*","YAHOO*","APPLE*"
 
Here is my question:
 
Can someone give me the correct syntax for a formula with multiple "not like" fields so I do not need to enter the line over and over?
 
Thank you,
Richard Scott

 




Replies:
Posted By: Emir_W
Date Posted: 22 May 2010 at 8:43pm
Can you try :
 
NOT (LEFT({DomainAddress},4) in ["DELL","YAHO","APPL"])
 
 
 
hope it help.
 


-------------
Emir W


Posted By: DBlank
Date Posted: 25 May 2010 at 5:09am
If you want to continue to use the LIKE option I think this should also work:
 
NOT ({DomainAddress} LIKE ["DELL*","YAHOO*","APPLE*"])



Print Page | Close Window