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.
Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
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.
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
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.
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