Welcome to Forums Sign in | Join | Help | Forums
in Search


Crystal Formula Help

Last post 10-13-2008 11:53 AM by Christine Adams. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-13-2008 11:31 AM

    • Christine Adams
    • Top 200 Contributor
    • User Since: 1989
    • Posts 41
    • Organization: University of Hartford
    • Products:  Blackbaud NetCommunity, The Raiser's Edge, The Researcher's Edge

    Crystal Formula Help

    I'm trying to add a formula into my crystal report - For the first names I want to join husband and wife with & if both exist.  Below is my formula:

    if {CnSpSpBio.CnSpSpBio_First_Name} > " " then {CnBio.CnBio_First_Name} + " & " + {CnSpSpBio.CnSpSpBio_First_Name} else if {CnSpSpBio.CnSpSpBio_First_Name}= " " then {CnBio.CnBio_First_Name}

     What's happening is that if the record doesn't have a spouse name at all the record is not appearing in preview. 

     Is there another place I need to set something so that it accepts the record whether it has spouse first name or not?

     Thank you.

     

    Christine E. Adams
    Senior Director of Advancement Services
    University of Hartford
    West Hartford, CT 06117
    cadams@hartford.edu
    P 860.768.2407
  • 10-13-2008 11:44 AM In reply to

    • Drew Allen
    • Top 10 Contributor
    • Posts 514
    • Organization: Children's Hospital of Philadelphia
    • Products:  The Information Edge, The Raiser's Edge

    Re: Crystal Formula Help

    If a field can be Null, then the first thing that you need to do is test whether it is Null.  If you don't do this, then the formula will simply return Null whenever the field is Null.

    Drew

    J. Drew Allen
    The Children's Hospital of Philadelphia
  • 10-13-2008 11:50 AM In reply to

    • Drew Allen
    • Top 10 Contributor
    • Posts 514
    • Organization: Children's Hospital of Philadelphia
    • Products:  The Information Edge, The Raiser's Edge

    Re: Crystal Formula Help

    Another minor point.  Since the {CnBio.CnBio_First_Name} is constant, there is no reason to include it inside the IF...THEN statement.  You could rewrite this formula as
    {CnBio.CnBio_First_Name} + IF IsNull({CnSpSpBio.CnSpSpBio_First_Name}) THEN " & " + {CnSpSpBio.CnSpSpBio_First_Name} ELSE ""

    Drew

    J. Drew Allen
    The Children's Hospital of Philadelphia
  • 10-13-2008 11:53 AM In reply to

    • Christine Adams
    • Top 200 Contributor
    • User Since: 1989
    • Posts 41
    • Organization: University of Hartford
    • Products:  Blackbaud NetCommunity, The Raiser's Edge, The Researcher's Edge

    Re: Crystal Formula Help

    Any suggestions on how I can get it to work - or do I simply need to put both first names in separate fields? 

    Christine E. Adams
    Senior Director of Advancement Services
    University of Hartford
    West Hartford, CT 06117
    cadams@hartford.edu
    P 860.768.2407
Page 1 of 1 (4 items)