Results 1 to 8 of 8

Thread: Crystal Reports v10 - Formula adding several fields, any of which may be null

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    24

    Crystal Reports v10 - Formula adding several fields, any of which may be null

    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!
    Last edited by huddy33; Apr 23rd, 2009 at 01:41 PM.

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Crystal Reports v10 - Formula adding several fields, any of which may be null

    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
    Last edited by jggtz; Apr 23rd, 2009 at 02:20 PM.

  3. #3
    Lively Member KTech's Avatar
    Join Date
    Jun 2008
    Location
    Pittsburgh
    Posts
    117

    Re: Crystal Reports v10 - Formula adding several fields, any of which may be null

    In SQL I use the isNull function in the query when the records are retrieved

    Code:
    isnull(colName, 0)

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    24

    Re: Crystal Reports v10 - Formula adding several fields, any of which may be null

    Quote Originally Posted by KTech View Post
    In SQL I use the isNull function in the query when the records are retrieved

    Code:
    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}
    Last edited by huddy33; Apr 23rd, 2009 at 02:42 PM.

  5. #5
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Crystal Reports v10 - Formula adding several fields, any of which may be null

    See post #2

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    24

    Re: Crystal Reports v10 - Formula adding several fields, any of which may be null

    Quote Originally Posted by jggtz View Post
    See post #2
    That did not work. Thank you though.

  7. #7
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    Re: Crystal Reports v10 - Formula adding several fields, any of which may be null

    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.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    24

    Re: Crystal Reports v10 - Formula adding several fields, any of which may be null

    Quote Originally Posted by rasinc View Post
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width