Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: IsNull statement with multiple arguments Post Reply Post New Topic
Author Message
Stephen W.
Newbie
Newbie
Avatar

Joined: 31 Mar 2009
Location: United States
Online Status: Offline
Posts: 7
Quote Stephen W. Replybullet Topic: IsNull statement with multiple arguments
     Posted: 30 Apr 2009 at 12:54pm
I am in need of syntax clarity for having (2) arguments within a IsNull statement.
The section that is colored red is to return a blank space when both data fields 'min & max' are empty or equal to 0.



Here is what I have right now  -  the red section is where I'm getting errors from: 



If IsNull ({limits.limit_imin_l1_t9}) or ({limits.limit_imin_l1_t9} = 0)
Then
'NMT-' + ToText(ToNumber({limits.limit_imax_l1_t9}), 0) + '%'

Else If IsNull ({limits.limit_imax_l1_t9}) or ({limits.limit_imax_l1_t9} = 0)
Then
'NLT-' + ToText(ToNumber({limits.limit_imin_l1_t9}), 0) + '%'

Else If IsNull ({limits.limit_imin_l1_t9}) or ({limits.limit_imin_l1_t9} = 0) and
       If IsNull ({limits.limit_imax_l1_t9}) or ({limits.limit_imax_l1_t9} = 0)
Then
' '


Else
ToText(ToNumber({limits.limit_imin_l1_t9}), 0) + '-' + ToText(ToNumber({limits.limit_imax_l1_t9}), 0) + '%'



Edited by Stephen W. - 30 Apr 2009 at 1:15pm


Stephen W.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Apr 2009 at 1:47pm
You had to IF's and you need to parenth the 2 or statements seperately
Else if
(IsNull ({limits.limit_imin_l1_t9}) or ({limits.limit_imin_l1_t9} = 0))
and
(IsNull ({limits.limit_imax_l1_t9}) or ({limits.limit_imax_l1_t9} = 0))
Then
' '
IP IP Logged
Stephen W.
Newbie
Newbie
Avatar

Joined: 31 Mar 2009
Location: United States
Online Status: Offline
Posts: 7
Quote Stephen W. Replybullet Posted: 30 Apr 2009 at 2:59pm
Thank you very much!

It worked!




I went for 13+ years without writing any code.  It's been a while.


Stephen W.
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