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!

Date range-pulling last date formula

Status
Not open for further replies.

cmhdover

Technical User
Jul 15, 2004
37
US
I have a report of hospital bed days - each client has a start date and an end date (unless they are still in the hospital). I need a report that shows monthly total of bed days -

I have a parameter for the user to enter the date range (they will use 12/1/04 - 12/31/04 for example).

The problem is I get all the clients who were admitted in December, but also the ones who were admitted in December but released in January. I want to calculate their total number of bed days for that month - not crossing over to the next.

I'm not quite sure what to do.........would appreciate your help!

Thanks,
Dennielle
 
hi
create a running total and select on change of patient

cheers

pg

pgtek
 
Try using a calculation something like:

if isnull({table.enddate}) or
{table.enddate} > maximum({?daterange}) then
datediff("d",{table.startdate},maximum({?daterange}) else
datediff("d",{table.startdate},{table.enddate})

-LB
 
Thank you lbass - you are awesome!

I appreciate your help!!!

Dennielle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top