Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Using compound conditions in SQL query Post Reply Post New Topic
Author Message
edluver216
Newbie
Newbie


Joined: 11 Apr 2012
Online Status: Offline
Posts: 2
Quote edluver216 Replybullet Topic: Using compound conditions in SQL query
     Posted: 24 Apr 2012 at 9:17am
Hello,
I was hoping someone could help me with a SQL query problem.  I am trying to adjust my query to consider a compound conditional statement, i.e. :
 
({tablea.fielda} <> 5566 And Not ({tablea.fieldb} like '%889009%))
 
The initial problem was that crystal would take that statement and remove the outside parenthasis and execute the statements independantly of each other.  I thought I had a fix by putting the entire statement in a "NOT" statement and reversing the conditions, like so:
 
Not ({tablea.fielda} = 5566 And ({tablea.fieldb} like '%889009%))
 
Although crystal did reverse the conditions and keep the conditions grouped, it is now changing the center "and" to an "or". 
 
This is a report that was created before my time that I am just modifying, and as such, I dont want to create a view or stored procedure that would cause me to go back and change all of the fields in the report.  Any ideas?
 
Thank you in advance!
-Edward
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum