Link to home
Start Free TrialLog in
Avatar of rwarren99
rwarren99Flag for United States of America

asked on

Using Switch and IsNull commands together - Crystal XI

I am using the Switch command with success untilllooking for the NULL.  See attachment.  The following 2 codes work but do not find  NULL and replace it with "Unknown".
switch ({C_BILLING.PatientType}like "E", "Emergency Room",
        {C_BILLING.PatientType}like "I", "Inpatient",
        {C_BILLING.PatientType}like "O", "Outpatient",
        {C_BILLING.PatientType}like ' ', "Unknown Account(s)")
OR
iif (IsNULL ({C_BILLING.PatientType}),"Unknown",
switch ({C_BILLING.PatientType}like "E", "Emergency Roomx",
        {C_BILLING.PatientType}like "I", "Inpatient",
        {C_BILLING.PatientType}like "O", "Outpatient"))

For testing,
I used:   iif (IsNULL ({C_BILLING.PatientType}),"Unknown", "xx")
It worked to return the "unknown".

What is wrong that will not allow either one of the first two codes to work?
Thank you....



Crystal-Help.jpg
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rwarren99

ASKER

THAT WORKED ...
THANK YOU...

I am running XI 11.5.8.826
Any reason why my code would not work?
Thanks Again...
Thank you for the assistance...
Avatar of Mike McCracken
Mike McCracken

As I stated, I don't know of a reason it doesn't.  It seems like it should but that may just be the way an iif works.

mlmcc
Thank you again for your assistance....