What is wrong with this formula?

Options
if {CnMem_1CurBft_1.CnMem_1CurBft_1_Total_Benefit_Value}<= 0 then "Our records indicate that you have not received any benefits associated with your donation." 

else "Our records indicate that you have received benefits valued at" {CnMem_1CurBft_1.CnMem_1CurBft_1_Total_Benefit_Value}.


I have created a formula field with the above forumula, but for the life of me can't get the benefit value to be an actual merge field.  In the above formula I get "the remaining text does not appear to be part of the formula" error message.  I've tried the "totext", I've put parenthesis around ({CnMem_1CurBft_1.CnMem_1CurBft_1_Total_Benefit_Value}), but nothing is working.


I KNOW I've successfully done this before, just at a loss at the moment. I'm exporting from RE to an Crystal Report version 11.5.12

 
Tagged:

Comments

  • Hi Elaine,


    I don't do much with CR - I try my best to avoid CR if I possibly can! - but I'd guess the problem is in the last ("else") part. I'd expect you'd to have to do something like:

    if {CnMem_1CurBft_1.CnMem_1CurBft_1_Total_Benefit_Value} <= 0 then

      'Our records indicate that you have not received any benefits associated with your donation.'

    else

      'Our records indicate that you have received benefits valued at ' + Totext ({CnMem_1CurBft_1.CnMem_1CurBft_1_Total_Benefit_Value}) + '.';



    So, basically, you need to convert the number to text and then concatenate the other text around it (with "+").


    Bit of a guess, but that's what I'd try.


    Cheers,

    Steve Cinquegrana | CEO and Principal Developer | Protégé Solutions

     
  • Try:

    "Our records indicate that you have received benefits valued at" + totext({CnMem_1CurBft_1.CnMem_1CurBft_1_Total_Benefit_Value})

     
  • Elaine Tucker
    Elaine Tucker Community All-Star
    Ancient Membership 500 Likes 100 Comments Photogenic
    That worked wonderfully Thank Ya'll so much!! 


    I now have the issue of dup lines in my detail section, so I figured I'd tackle the while printing formula, but am totaly lost.

    Normally I would create a sub report and group by gift id and then sum, but wanted to give this a try.


    Group1 is ConsSort key

    Group2 is Fund Category

    Details....this is what SOME of the detail sections look like - only happening on some NOT all donors:

    The value on the far right is the gift id.

    ff002628eb75ce5936a111311416df66-huge-li


    Will While Printing fix the detail or should I just create a sub-report like always.

    I did get the summary total to be correct by using the running total formula.


    Thanks again,

    Elaine



     
  • This generally has to do with your joins on the various tables.  There is a value in one of those tables that has multiple records on the right for the one record on the left.  Usually by fixing the joins, you can correct the problem.  However, if the duplicating value is on your report, then you may have to create a group for that value.  This may be clear as mud, but first check your joins.

Categories