Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: adding null fields Post Reply Post New Topic
Author Message
chris64
Newbie
Newbie


Joined: 19 Mar 2014
Online Status: Offline
Posts: 13
Quote chris64 Replybullet Topic: adding null fields
    Posted: 25 Mar 2014 at 7:36am
Hi,
 
I am trying to add together string fields from the source database  that generally have numbers in. To do this I am converting to number using the ton umber() function. This works fine except when there is nothing in the field - a 'null' value. This does not hinder at the tonumber stage but when I come to add up the resultant numbers. can anybody help to convert the nulls to zeroes and so allow the addition.
 
Thanks
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 25 Mar 2014 at 8:02am
try a formula like
if isnull(you_field) then 0 else tonumber(your_field)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Mar 2014 at 9:34am
or inside your formula set the option about how to use nulls to
'use default values for nulls'
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.016 seconds.