cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Conditional Formula in Crystal Reports

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks for your response, unfortunately when I use this formula it is coming up with an error message saying "boolean is required here" and it highlights "No" .

Can you help, what am I missing, sorry but my formula creation skills are quite basic and i dont know what it means

former_member260594
Active Contributor
0 Kudos

Hi Louise,

Try removing the quotation marks around the No to make it a true boolean as opposed to a string.

Regards,

Graham

abhilash_kumar
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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