Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: IF-THEN statement - Not returning values Post Reply Post New Topic
Author Message
jtr8178
Newbie
Newbie


Joined: 09 Jan 2014
Location: United States
Online Status: Offline
Posts: 5
Quote jtr8178 Replybullet Topic: IF-THEN statement - Not returning values
    Posted: 28 Jul 2014 at 4:38am
I have a pretty simple IF-THEN statement:

if {@Translate} <> "Down Unit" and {LRCON.Status} = 312 then {LRCON.CusName} else
if {@Translate} = "Down Unit" then "Down Unit" else
if isnull({@Translate}) then "Available" else
"Available"

I have about 150 records, and it works perfect on all except 2. The output it just "null". In both cases, the records return nothing at all. They should at least be putting out "Available", correct? Why aren't they??? :(
Tyler - Robertson
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 28 Jul 2014 at 4:59am
first response is to check if @Translate is returning a null...that will pretty much invalidate the whole process.

since a null cannot be compared to any string, CR, I believe, throws an error and aborts the process...it just doesn't bother to tell anyone.

if something can be null, always check for null before doing anything else, otherwise CR's results can be, shall we say, unpredictable.
IP IP Logged
jtr8178
Newbie
Newbie


Joined: 09 Jan 2014
Location: United States
Online Status: Offline
Posts: 5
Quote jtr8178 Replybullet Posted: 28 Jul 2014 at 5:11am
Yea, I threw that null in there to try to catch any errors... but I figured it out. {LRCON.CusName} didn't exist for some records, so I added another string to it. Thanks for the quick response!
Tyler - Robertson
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.