Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Multiple if statements in select Post Reply Post New Topic
Author Message
chellbelle
Newbie
Newbie


Joined: 08 Aug 2010
Online Status: Offline
Posts: 1
Quote chellbelle Replybullet Topic: Multiple if statements in select
     Posted: 08 Aug 2010 at 4:10pm

I'm trying to use 2 if statements in the main report select query but the 2nd statement seems to be ignored.  Is there an alternative to doing this as below?, eg:

 
{Calls.CallType} = "REQUEST" and
 
if {?Year} = 2010 then
   {Calls.CallType} = 'a'
else
   {Calls.CallType} = 'b'
 
and
 
if {?Type} = 1 then
   {Calls.Activity} = 'XX'
else
   {Calls.Activity} = 'YY'
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Aug 2010 at 4:03am
{Calls.CallType} = "REQUEST" and
(
({?Year} = 2010 and {Calls.CallType} = 'a')
or
({?Year} <> 2010 and {Calls.CallType} = 'b')
 )
and
(
({?Type} = 1 and {Calls.Activity} = 'XX')
or
({?Type} <> 1 and {Calls.Activity} = 'YY')
)
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