Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: ISNULL Summary Data Post Reply Post New Topic
Author Message
jhandscha
Newbie
Newbie


Joined: 09 Sep 2008
Location: United Kingdom
Online Status: Offline
Posts: 1
Quote jhandscha Replybullet Topic: ISNULL Summary Data
     Posted: 09 Sep 2008 at 8:32am
Hey there,

I have a summary field in my report to return a DistinctCount of the number of "orders" in a specific "job group." But sometimes if there are no orders in a specific job type, it will not return any result. I would like it to give a result of "0". I've killed myself working with the ISNULL functions and whatnot, but can't seem to figure out how to make the summary give me a number if there are null records.

My count code is called "COUNT 01":
DistinctCount({INSPECTION.INSP_ID}, {INSPECTION.INSP_STATUS_CODE})

When there are no INSP_ID 's for a specific INSP_STATUS_CODE, it shows nothing, but I want it to show zero.

I thought this would work:

If ISNULL({@COUNT 01}) then "0" else {@COUNT 01}
but of course it says I need a string for the last term.

What's a guy to do?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 09 Sep 2008 at 12:37pm
From your code, I assume that "job group" is defined in the {INSPECTION.INSP_STATUS_CODE} field, correct? 
 
Do you have another table that contains all of the codes?
 
-Dell
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 10 Sep 2008 at 4:54am
in the formula editor box there are two options "Exceptions For Nulls" & "Default Value For Nulls", and i am sure the option selected by you is "Exceptions For Nulls" , change  it to "Default Value For Nulls", you may get 0 if a field or formula is numeric and the data is null. This depends upon the value u have set in your crystal report for nulls. But by default for a numeric field or numeric formula the null value will be 0.
Thanks
Savan
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 10 Sep 2008 at 8:59am
Savan,
  That will only work if all of the codes are available for a specific order.  In other words, if there's a "lookup" table that has all of the codes and what they mean.  If you're working with just the Inspection table and the code does not exist for a specific order, there's no way to provide a 0 count for the codes that don't exist.
 
-Dell
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 10 Sep 2008 at 11:14pm
Yes, Dell i agree with you
Thanks
Savan
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