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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Operating Rooms Running Report

Status
Not open for further replies.

newbie0423

IS-IT--Management
Oct 29, 2012
103
US
Hello,

I am using Crystal 11. I'm trying to create a report that will show how many operating rooms are running for a particular hour of the day. I am using the patient's in room time and the patient's out of room time. Using these two fields/times helps me to count the number of CASES for the hour, sometimes there can be two or more cases in the room within one hour. I would like my end result to be the number of ROOMs running, NOT CASES.

This is the forumula that I am using for each hour. If the patient's in time is between 3:00 and 3:59 it is marked with a "1" if not then a "0" . I then total the number of cases for that hour.

If Not (
Time(Picture(ToText({v_CRA_20_Billing.time_pat_in_room},'0000'),"xx:xx")) > Time(15,59,0) or
Time(Picture(ToText({v_CRA_20_Billing.time_pat_out_of_room},'0000'),"xx:xx"))< Time(15,0,0)
)
Then 1


Any help or suggestions will be appreciated. Thanks very much!
 
It would have helped to know the format of the time values, but I will assume that you are getting the correct times. I am not sure you need both Totext and Picture. If you put the colon in the ToText format string you should be able to skip the picture function. And, the NOT just confuses me. See if this works:

if
Hour (Time(Picture(ToText({v_CRA_20_Billing.time_pat_in_room},'0000'),"xx:xx"))) <= 3
and
Hour (Time(Picture(ToText({v_CRA_20_Billing.time_pat_out_room},'0000'),"xx:xx"))) >= 3
then 1
else 0

In other words, if they are in the room during or before the hour and leave the room either during or after the hour then they must have been in the room for that hour.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top