Skip to Content
avatar image
Former Member

Creating a Conditional Formula in Crystal Reports

Hi

I was hoping someone could help me write a conditional formuala for a report.

The report layout and data is entered as follows:

Start Date End Date Absence Reason RTW?

11 June 2013 15 June 2013 Sickness Yes

I want to be able to run a report that only shows a value in the "End Date" field if "RTW?" equals Yes, if "RTW?" equals No, I want the "End Date" field to remain blank. Can anyone help me write the fomula to do this.

thanks

Loula1978

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 25, 2013 at 02:04 PM

    Hi Louise,

    Right-click the End Date field on the Details Section and select Format Field > Common tab > click on the formula button beside Suppress and use this code:

    {RTW?} = "No"

    Replace {RTW?} with the database field for RTW?.

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

    • Strange! I tested with the same values with an Excel Sheet and it works without any errors.

      What is 'RTW?'? Is it a database field or a parameter or formula that returns a boolean value?

      Does it return the string Yes or No?

      Graham's suggestion should work in case it returns a boolean value.

      -Abhilash

  • avatar image
    Former Member
    Jun 26, 2013 at 07:39 AM

    Thanks both of you, it works fine when I remove the " " from No.

    Add comment
    10|10000 characters needed characters exceeded