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

Calculating bed days in Crystal

Status
Not open for further replies.

Karchan

Technical User
Mar 22, 2012
9
CA
Hello,
I'm wondering if anyone knows how (or if it's even possible) to calculate "bed days" in Crystal? I work in a hospital and require to report how many beds were occupied each day. The only fields I have access to are date of admission and date of discharge.

For example, if a patient was admitted on April 29 and discharged on May 2, I want to show the following:

Date Total bed days
April 29 1
April 30 1
May 1 1
May 2 0

If no one was admitted on May 3, May 3 would show “0” etc.
Is this possible to do in Crystal?
 
Create a Calendar table with one row for each date.
"Join" it to your Admissions table using a condition of
Cal.Date >= Admit_Date AND Cal.Date < Discharge Date

Group on Cat_Date, and simply count... :eek:)

hth,
- Ido

view, export, burst, email, and schedule Crystal Reports.
 
To calculate the bed days for a single date you can have a formula (either as a selct formula or the condition formula in a runing total) like this.

{admit_date} <= {?target_date}
and (isnull({discharge_date}) or {discharge_date} > {?target_date})
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top