I have a Crystal Report 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}
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}