Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: IF Statement Problem Post Reply Post New Topic
Author Message
grego
Newbie
Newbie
Avatar

Joined: 22 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 16
Quote grego Replybullet Topic: IF Statement Problem
     Posted: 10 Mar 2008 at 2:05am
I seem to be having problems figuring out the order to list things in an IF statement in Crystal XI.
 
I basically want the text "Auto debit Credit" to appear if the Counterparty is counterparty number 2254 or 1103 and the currency is anything other than GBP or if the counterparty is counterparty number 1208 or 1140 and the currency is GBP.  Otherwise If the amount is negative (the @REC/PAY formula = "PAYMENT) and the counterparty is classified as external (The Cparty.Deal_Int field = "N") I want the field to display The counterparty code, currency and deal type - otherwise if the c.party deal_Int field = "Y" I want the field to display the Facility name - but if this is ="NONE" to display the Deals.CP_Ref field.
 
This is what I have written....However none of the External coding part seems to have worked as they all come back blank and the only part that seems to have worked is the first couple of lines.
 
Your help would be very much appreciated!!Smile
 
If {DEALS.CPARTY}="2254" or {DEALS.CPARTY}="1103" and {diaryrpt.CCY}<> "GBP" then "Auto Debit Credit" else if {DEALS.CPARTY}="1208" or{DEALS.CPARTY}="1140" and {diaryrpt.CCY}="GBP" then "Auto Debit Credit" else If {@REC/PAY}= "PAYMENT" then if {cparty.DEAL_INT}="N" then {cparty.CODE} & {diaryrpt.CCY} & {diaryrpt.TRANS_TYPE} else if {FACILITY.NAME}="NONE" then {DEALS.CP_REF} else {FACILITY.NAME}

else ""

IP IP Logged
MaddMatt
Newbie
Newbie
Avatar

Joined: 18 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 17
Quote MaddMatt Replybullet Posted: 10 Mar 2008 at 7:08am
Hi,
 
I've added a few brackets to your code and changed the logic slightly in the middle...
 
If ({DEALS.CPARTY}="2254" or {DEALS.CPARTY}="1103") and {diaryrpt.CCY}<> "GBP" then "Auto Debit Credit"
 
else
 
if ({DEALS.CPARTY}="1208" or{DEALS.CPARTY}="1140") and {diaryrpt.CCY}="GBP" then "Auto Debit Credit"
 
else
 
If {@REC/PAY}= "PAYMENT" and {cparty.DEAL_INT}="N" then {cparty.CODE} & {diaryrpt.CCY} & {diaryrpt.TRANS_TYPE}
 
else
 
if {FACILITY.NAME}="NONE" then {DEALS.CP_REF} else {FACILITY.NAME}
 
else
 
""
 
Have you checked that your output is blank and not null?
 
Try changing the 'Exceptions For Nulls' option to 'Default Values For Nulls' and see if that makes a difference.
 
Cheers,
 
Matt
There are 10 types of people. Those that understand binary, and those that don't.
IP IP Logged
grego
Newbie
Newbie
Avatar

Joined: 22 Feb 2008
Location: United Kingdom
Online Status: Offline
Posts: 16
Quote grego Replybullet Posted: 10 Mar 2008 at 9:25am
Worked a treat thanks Matt - that's great!Smile
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