PDA

Click to See Complete Forum and Search --> : Crystal Reports v10 - Formula adding several fields, any of which may be null


huddy33
Apr 23rd, 2009, 01:29 PM
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!

jggtz
Apr 23rd, 2009, 01:47 PM
It could help if you checkMenu/File/Options/Reporting/Convert Null Field Value to Default
so it will be not neccesary to check if they are Null

KTech
Apr 23rd, 2009, 02:07 PM
In SQL I use the isNull function in the query when the records are retrieved

isnull(colName, 0)

huddy33
Apr 23rd, 2009, 02:29 PM
In SQL I use the isNull function in the query when the records are retrieved

isnull(colName, 0)


I'm not sure what you mean; this is the formula I'm trying to modify to skip the nulls and continue to add even if one of the fields is null

{Employees.GroupDisabilityRate}
+{Employees.MedicalDependentRate}
+{Employees.DentalEmployeeRate}
+{Employees.DentalDependentRate}
+{Employees.GroupADDCoverageRate}
+{Employees.GroupLifeCoverageRate}
+{Employees.GroupLifeCoverageDependantRate}
+{Employees.VisionElectiveRate}
+{Employees.SupplementLifeElectiveRate}
+{Employees.SupplementADDElectiveRate}
+{Employees.AFLACElectiveRate}

jggtz
Apr 23rd, 2009, 05:12 PM
See post #2

huddy33
Apr 23rd, 2009, 06:01 PM
See post #2

That did not work. Thank you though.

rasinc
Apr 23rd, 2009, 08:25 PM
That setting in Post #2 is for all NEW reports. Your's is not new anymore. Go to File, Report Options and set the setting there for the current report.

huddy33
Apr 24th, 2009, 10:42 AM
That setting in Post #2 is for all NEW reports. Your's is not new anymore. Go to File, Report Options and set the setting there for the current report.

This worked! Thank you so much!:)