Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Claremont, CA
    Posts
    38

    Unanswered: If-Then-Else in Crystal 9 Formula

    I have a Crystal Report 9 using an Oracle 9i db where I use the IF-THEN-ELSE to decode a field. The formula field, PHONETYP, is based on the database field DETAIL_CD. Previously, I included PHONETYP in the statement below but it was not accepted. Below is the IF statement which has no compile error but which does not take effect in the report.

    if {ECON_DETAIL_V.DETAIL_CD}="EMG_F" then
    "Emg Pager"
    else if {ECON_DETAIL_V.DETAIL_CD}="EMG_P" then
    "Emg Home"
    else if {ECON_DETAIL_V.DETAIL_CD}="EMG_C" then
    "Emg Cell"
    else if {ECON_DETAIL_V.DETAIL_CD}="PHONE" then
    "Office"
    else if {ECON_DETAIL_V.DETAIL_CD}="PAGER" then
    "Emg Pager"
    else if {ECON_DETAIL_V.DETAIL_CD}="HPHN" then
    "Emg Phone"
    else
    {ECON_DETAIL_V.DETAIL_CD}

  2. #2
    Join Date
    Jan 2004
    Location
    Claremont, CA
    Posts
    38

    If-then-else

    Please disregard the message I posted. I checked the report and I had not included the formula field in the report, but when I did, it was ok. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •