Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Crystal Reports v10 - Formula adding several field Post Reply Post New Topic
Author Message
huddy33
Groupie
Groupie


Joined: 23 Apr 2009
Location: United States
Online Status: Offline
Posts: 54
Quote huddy33 Replybullet Topic: Crystal Reports v10 - Formula adding several field
    Posted: 23 Apr 2009 at 12:51pm
I am not sure how to add these fields together in a formula and always return a value, be it 0 or >0. They are currency fields and the majority of the eight fields will be null. Those that are not null in the formula are still returning a null value overall, after stopping with the first null evaluation. How can I write this?

I've tried trimming the field and <>"", but nothing works. Thanks for any help!

This is the formula as is, not working after the first field returns a null value:
{Employees.GroupDisabilityRate}
+{Employees.MedicalDependentRate}
+{Employees.DentalEmployeeRate}
+{Employees.DentalDependentRate}
+{Employees.GroupADDCoverageRate}
+{Employees.GroupLifeCoverageRate}
+{Employees.GroupLifeCoverageDependantRate}
+{Employees.VisionElectiveRate}
+{Employees.SupplementLifeElectiveRate}
+{Employees.SupplementADDElectiveRate}
+{Employees.AFLACElectiveRate}
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 23 Apr 2009 at 1:39pm
2 thoughts come to mind:
1) File/Options/Reporting  check the convert null values to default
2) create a formula with local variables
 
local numbervar gdr := {Employees.GroupDisabilityRate};
 
//check if the variable is null, if so assign the 0
if isnull(gdr) then gdr := 0;
 
//finally, add them all up  gdr+...
 
Hope one of these ways is useful.
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.047 seconds.