Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Treating a null as a zero Post Reply Post New Topic
Author Message
Megan10e
Newbie
Newbie


Joined: 19 Aug 2010
Online Status: Offline
Posts: 24
Quote Megan10e Replybullet Topic: Treating a null as a zero
     Posted: 30 Nov 2010 at 5:47am
I'm trying to do some calculations in my report with null fields. When they are null, they should be counted as zeros, but I'm not sure how to do this. None of my totals are showing, and I think this is the problem.
 
I want to have this formula: ordertotal - (rentdiscount + salesdiscount), but rentdiscount and salesdiscount are often null. How can I get the formula to recognize the null values as zeros?
 
Thank you!
IP IP Logged
louisville2k10
Groupie
Groupie
Avatar

Joined: 13 Sep 2010
Location: United States
Online Status: Offline
Posts: 45
Quote louisville2k10 Replybullet Posted: 30 Nov 2010 at 5:56am
try writing a formula that goes something like, if isnull(rentdiscount) then "0" else (rentdiscount)
 
I've never done anything like this before, but logically it seems that it might work...
Thanks for your help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Nov 2010 at 6:38am
also depending on your version in a formula editor workshop Expression Editor there is the option to use "exceptions for Nulls" or "Default values for Nulls". Set it to 'Use default values'.
 
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