| Author |
Message |
jtr8178
Newbie
Joined: 09 Jan 2014
Location: United States
Online Status: Offline
Posts: 5
|

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 Logged |
|
|
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
|

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 Logged |
|
jtr8178
Newbie
Joined: 09 Jan 2014
Location: United States
Online Status: Offline
Posts: 5
|

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 Logged |
|
|
|