Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Solved "Isnull" not working, but "not isnull" will Post Reply Post New Topic
Author Message
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Topic: Solved "Isnull" not working, but "not isnull" will
    Posted: 06 Jul 2015 at 6:51am
I am wanting to restrict my data based on simple logic.  Only show me data  if {table.field} is empty.  So I tired using the following record selection formula

isnull({table.field})


The field is a string.  When I refresh my data i return zero records.  If I use the opposite  not isnull({table.filed})  then the report returns records. 

I have tried using default values and exceptions for null values with no luck. 




Edited by bremen - 07 Jul 2015 at 12:31am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jul 2015 at 7:31am
are you sure it is NULL and not an empty string?

trim({table.field})=""
IP IP Logged
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Posted: 06 Jul 2015 at 8:04am
where would I put that?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 06 Jul 2015 at 8:35am
I have gotten in the habit (thanks to Ken Hamady) to check for empty strings instead of nulls (i.e., Len({field}) = 0).  I also set the Default Values for Nulls in the formula editor.
IP IP Logged
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Posted: 06 Jul 2015 at 8:42am
So how would I use either of these functions to limit the records returned by my report? 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Jul 2015 at 8:45am
in the select expert set the formula to 'use default values for nulls' and the criteria would be

trim({table.field})=""

If it is possible for users to enter a space (or more) into the field the trim will remove those
IP IP Logged
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Posted: 07 Jul 2015 at 12:30am
Now I got cha. 

Thank you very much for the help.
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.