Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate an Isnull

Status
Not open for further replies.

JonathanNYC

IS-IT--Management
Mar 29, 2003
111
US
I am successfully counting operating rooms that start with the letter "A" and an admission status = "AMS" (see formula I am using below). There are a few sitautions where the admission status is empty and I wish to count the number of such instances.

Here's the formula I am using to count AMS:

if {pcmORroom.orName} startswith "A" and {pcxHospInfo.admissionStatus} = "AMS" then
1
else
0

Requesting help with syntax that would allow me to count the number of cases in a room starting with A when the field is empty.

I am thinking there is an isnull as part of the formula.
I am using CR10.
 
Try this
Code:
If IsNull({pcxHospInfo.admissionStatus}) 
and {pcmORroom.orName} startswith "A"
then 1

Notice that the IsNull check is always done first.

Bob Suruncle
 
Is this in addition to the current count, or a new formula that only counts nulls?

if (isnull({pcxHospInfo.admissionStatus})
or
{pcxHospInfo.admissionStatus} = "AMS")
and
{pcmORroom.orName} startswith "A" then
1
else
0

To add it use the above, to create a new one of only the nulls, omit the

or
{pcxHospInfo.admissionStatus} = "AMS"

-k
 
Bob, my sincere thanks for the perfect reply three minutes after I posted the question. Works perfectly and I have ntoed your point about placing the isnull first. Thank you very much, you made my Friday.
 
thanks synapsevampire for your solution too - you remain incredibly helpful to me (and hundreds of others, i am sure) as well)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top