• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 642
  • Last Modified:

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
0
rwarren99
Asked:
rwarren99
  • 3
  • 2
1 Solution
 
mlmccCommented:
I don't know why those don't work

I would do it as

If IsNull({C_BILLING.PatientType}) then
    "Unknown"
Else
    Your Switch or if statements.

mlmcc
0
 
rwarren99Author Commented:
THAT WORKED ...
THANK YOU...

I am running XI 11.5.8.826
Any reason why my code would not work?
Thanks Again...
0
 
rwarren99Author Commented:
Thank you for the assistance...
0
 
mlmccCommented:
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
0
 
rwarren99Author Commented:
Thank you again for your assistance....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now