Skip to Content
0

Crystal Reports formula

Nov 30, 2017 at 02:08 PM

27

avatar image
Former Member
I am new to Crystal Reports and am learning as I go. I am working on a formula that will leave me a date or if the second date field is empty(Null) then I can have it leave a word of my choice like "OPEN" I can't seem to get the two statements to work together.

{hosp_crisis_admit.discharge_date}-{hosp_crisis_admit.admit_agency_start_date}
IF IsNull({hosp_crisis_admit.discharge_date})=true then "TEST"

CR 2013 SP1

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Ian Waterman Nov 30, 2017 at 03:33 PM
0

what is your formula? what you pasted will not work

{hosp_crisis_admit.discharge_date}-{hosp_crisis_admit.admit_agency_start_date}
IF IsNull({hosp_crisis_admit.discharge_date})=true then "TEST"
What did you want this to do? It is not clear from your question

This on its own will work
IF IsNull({hosp_crisis_admit.discharge_date})=true then "TEST"

Ian

Share
10 |10000 characters needed characters left characters exceeded
Abhilash Kumar
Dec 05, 2017 at 08:34 AM
0

Hi Steve,

Create a formula with this code:

IF {hosp_crisis_admit.discharge_date} = date(0,0,0) THEN 'OPEN'
Else totext({hosp_crisis_admit.admit_agency_start_date} - {hosp_crisis_admit.discharge_date},'#')

In the formula editor, look for a drop-down on the top called 'Exceptions for Nulls'; change that to 'Default Values for Nulls'

Save the formula.

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded