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!

Calculating Recidivism days

Status
Not open for further replies.

RepRider

Technical User
Jan 25, 2007
114
US
CRXI with SQL

I have a report that is grouped by ConsumerID and EpisodeEndDate that shows the number of times a person was discharge within a Fiscal Year and some detail about types and number of services provided. I have a formula for the LOS (length of stay) for each episode of care for each consumer but now I would like to find out the length of time between each episode of care of each consumer. That is the number of days from a discharge to the next admission date.
There will be at least 2 episodes of care for each consumer and maybe more.

The formula to figure the LOS is:
({Episode.end_date}-{Episode.begin_date})

How would I write the formula for the number of days from a discharge to the next admission date?

Thanks in advance for any assistance.
 
You would sort ascending by begin date, and then use a formula like this:

if onfirstrecord or
{table.consumer} <> previous({table.consumer}) then
0 else
{episode.begin_date}-previous({episode.end_date})

-LB
 
Thanks LB... I was close but you were perfect!! I learn something new everytime I visit here. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top