Skip to Content
author's profile photo Former Member
Former Member

Crystal Reports formula

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 30, 2017 at 03:33 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2017 at 08:34 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.