Discussions

Expand all | Collapse all

Is this the correct use of the Case function and/or is there a better way to do this?

  • 1.  Is this the correct use of the Case function and/or is there a better way to do this?

    Posted 05-31-2018 14:58
    Admittedly, I may be completely wrong in my approach here, but I'm trying to create a formula using the Case function that does this:

    If there's a value in [Created Date], return that value, or if there's a value in [Activity Date/Time], return that value, else return the value in [Date Created].

    (NOTE: There is never a case where there would be a value in both the [Created Date] and [Activity Date/Time].)

    Below is the formula I've tried using "Formula Date" field and also using a "Formula Date / Time" field:

    Case (not isnull([Created Date])), [Created Date], (not isnull([Activity Date/Time])), [Activity Date/Time], [Date Created])

    In both cases, I get this error: the first "isnull" is highlighted in yellow and the message is "expecting date".

    Is this the correct use of the Case function and/or is there a better way to do this?


  • 2.  RE: Is this the correct use of the Case function and/or is there a better way to do this?

    Posted 05-31-2018 15:00
    IF(
    not isnull([Created Date]), [Created Date],
    not isnull([Activity Date/Time]), [Activity Date/Time],
        [Date Created])


  • 3.  RE: Is this the correct use of the Case function and/or is there a better way to do this?

    Posted 05-31-2018 15:48
    That works! (of course) Thank you so much. :)