Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Formula comparison Null or not Null Post Reply Post New Topic
Author Message
shiloh
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 26
Quote shiloh Replybullet Topic: Formula comparison Null or not Null
    Posted: 18 Oct 2011 at 6:00pm
Hi,

I do have a problems on this formula,

I have a formula field call "confirm", in side I put this

if ({?stdconfirm}) = 'Null'
then ToText ("SI - Non Confirm")
else If ({?stdconfirm}) = 'ALL'
then ToText ("SI - Confirm & Not Confirm")
else ToText ("SI - Confirm")

In the Selection Formula I put this

(
if {?stdconfirm} ='NULL'
then (isnull ({SI.DateConfirm}))
else
    if {?stdconfirm} ='ALL'
     then (isnull ({SI.DateConfirm})) and (not isnull ({SI.DateConfirm}))
    else
        if{?stdconfirm} <>'NULL'
        then (not isnull ({SI.DateConfirm}))
          else
          false
)

My result only shown "Null" and <>"Null" output. For "All" is did not appear.

Can anyone help me to solve this issue?
My dateconfirm field is datetime and allow null in the database table

Thanks a lot for the help

Regards,
shiloh

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Oct 2011 at 3:55am
I would change your options to 'ALL', 'NULL' or 'NOT NULL'
then the select statement should be:
(
{?stdconfirm} ='ALL'
or
({?stdconfirm} ='NULL' and isnull({SI.DateConfirm})
or 
({?stdconfirm} = 'NOT NULL' and not (isnull ({SI.DateConfirm})) )
)



Edited by DBlank - 19 Oct 2011 at 3:56am
IP IP Logged
shiloh
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 26
Quote shiloh Replybullet Posted: 19 Oct 2011 at 4:41pm
Originally posted by DBlank

I would change your options to 'ALL', 'NULL' or 'NOT NULL'
then the select statement should be:

(

{?stdconfirm} ='ALL'

or

({?stdconfirm} ='NULL' and isnull({SI.DateConfirm})

or ({?stdconfirm} = 'NOT NULL' and not (isnull ({SI.DateConfirm})) ))

Hi Dblank,

Thanks for your help

The report work prefect now.

Thanks a lot
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.012 seconds.