Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show null value as zero

Status
Not open for further replies.

loveyoursite

Technical User
Apr 14, 2005
100
US
CRV10 - Could someone please help me with my formula? I have a running total that if the result is 0, then I need to see 0 on the report instead of a blank field. My running Total setup is:

Field to Summarize: @End of Mth
Type of summary: sum

Evaluate - use formula: {@OTHER License} = "01"

Reset on change of group: Group#1:EMPLOYEE.PROCESS_LEVEL

I tried formatting the field to show Zero as "0" but that did not fix the problem.

Example: License 01 License 02 License 03
17 42 0

Thanks!
 
You could create a formula instead of a running total field.
Code:
// Counter Formula
Numbervar Counter;
If {OTHER License}="01" then Counter:=Counter+1 else Counter

Then add in another formula in your group header which will reset the Counter :
Code:
// Reset counter value
Numbervar Counter:=0;

Place Counter Formula in group footer and the other formula in the group header.

ShortyA
 
Put it in a formula field. Say
Code:
If isnull(@total) then 0
else @total

Having come to Crystal from mainframe languages, I got a 'cultural shock' when encountering null. It means 'no data': Mainframe languages mostly treat this as the same as zero.
It is actually a finer shade of meaning, the difference between 'Yes, we have no bananas' and 'I don't know how many bananas we have, it could be some, it could be zero'. In Crystal, the entry is 0 or null and can be tested for.
Note that Crystal assumes that anything with a null means that the field should not display.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top