Print Page | Close Window

Including Null Records in a Range

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12006
Printed Date: 04 May 2025 at 12:23am


Topic: Including Null Records in a Range
Posted By: Foxman
Subject: Including Null Records in a Range
Date Posted: 07 Jan 2011 at 4:08am
Newbie here!  In the past I have always came to this forum and found a solution to my issues, but this time I couldn't find anything about this exact issue I'm experiencing.

I'm trying to pull over User Initials from "   " to "KZZ" on a bar graph, but I need it to include "null" records too.  I have a subreport with a bar graph that includes "L  " to "ZZZ".   I also have a start & end date parameters in place, which works perfectly.

Can someone please tell me why my formula won't give me the null records? Or possibly suggest different formulas to try?  My formula currently is:

{Tables_1.Insert_Date} = {?Choose Beginning Date} to {?Choose Ending Date} and
{Tables_1.UserInitials} in ['   ' to 'KZZ'] or
{Tables_1.Insert_Date} = {?Choose Beginning Date} to {?Choose Ending Date} and
IsNull({Tables_1.UserInitials})

Thank you in advance for your help!



Replies:
Posted By: DBlank
Date Posted: 07 Jan 2011 at 5:55am
if you are uing "" for null flip the formula option to ' use default values for null'
 


Posted By: Foxman
Date Posted: 07 Jan 2011 at 6:35am
Thank you for responding so quickly!  This might be a stupid question, but I have only been using Crystal for about 3 months and I'm mainly self taught.  Can you please explain a little more in depth on this or maybe give me an example of how to use this in a formula?  Again, thank you for your help!


Posted By: DBlank
Date Posted: 07 Jan 2011 at 7:11am
I did not see your ISNULL statement at the end.
If you use an ISNULL statement you have to make it the first condition in the entire statment.
As for my other suggestion you might not have this option. I am using CR XI. Other users have not found the option I am referring to but ... inside the formula editor there is an drop down list option to choose how to handle null values as either null or as a default value.
if your data is NULL instead of an empty string you have to decide how you want to deal with it. If you do state how to handle a NULL or use the option I mentioned above a formula will stop evaluating when it hits a NULL and return nothing.
I also have never had luck with using "X to Y" on an alpha.
Maybe try left(uppercase(field),1) in ['A','B',...]
 


Posted By: Foxman
Date Posted: 02 Feb 2011 at 9:30am
I was able to get this resolved.  Thank you all for your help!



Print Page | Close Window