Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Null value Post Reply Post New Topic
Author Message
Flyfisher
Newbie
Newbie


Joined: 11 Apr 2011
Online Status: Offline
Posts: 6
Quote Flyfisher Replybullet Topic: Null value
    Posted: 11 Apr 2011 at 10:21am
I've got a field that is numeric, but has NULL instead of a numeric value.  Including that field in calculations for other fields works when it has a value, but when it doesn't, it shows as blank and so do the other fields that use it in calcs.  Any ideas on how to get around this?
IP IP Logged
mpcrob
Newbie
Newbie
Avatar

Joined: 11 Apr 2011
Location: Netherlands
Online Status: Offline
Posts: 6
Quote mpcrob Replybullet Posted: 11 Apr 2011 at 11:21pm
Use an If condition instead of just the field:
 
if isnull({fieldname}) then 0 else {fieldname}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Apr 2011 at 4:27am
also depending on what version you are using you can use the option in the formula editor / Expression Editor to use 'Default values for Nulls'.
IP IP Logged
Flyfisher
Newbie
Newbie


Joined: 11 Apr 2011
Online Status: Offline
Posts: 6
Quote Flyfisher Replybullet Posted: 12 Apr 2011 at 6:39am
Originally posted by mpcrob

Use an If condition instead of just the field:
 
if isnull({fieldname}) then 0 else {fieldname}
 
 
This is what I tried and it worked.  Thanks for the help.
 
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.