on 10-08-2008 10:24 AM
I have one table that stores admission and discharge dates for patients admitted to our facility. I select a date range with parameters setting a start and end date for the report and ask to see all admissions for that range. One patient may be admitted several times in that timeframe so would show a record for each admission. I need a formula to calculate the time from the last discharge to the current admission. For example:
John Doe Admitted 5/1/08, discharged 6/1/08
John Doe Admitted 7/1/08, discharged 8/1/08
I am looking for any patients that were readmitted within 6 months of their last discharge. So am trying to get the datediff between the 7/1/08 admit and the previous record's 6/1/08 discharge date. I don't know how to write a formula to compare the two date fields from different records for the same patient.
group by patient id
then create a group for admit date
create a group for discharge date
then create a formula to calculate the maximum discharge date of a patient.
create one for max admin date
datediff('m',,)
this will give you the months between your last discharge to the current admin dates
you can then use the datediff formula to conditionally surpress the sections on the report, it cant be used in the record or group selection due to evaluation time.
give that a try...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
need to look at Previous or PreviousValue functions.
PreviousValue returns the value of the previous record of the specified field.
Dom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.