I need some assistance with a running total / which may involve the use of a formula. Just a little background on the issue.
A patient can present to the clinic for one of two case types: Medical or BHS. (BHS = Behavioral Health). A patient can also be treated by both case types on a given day. What I need to do is return a total number of days a patient was off sick for both case types and count the day as one day when the case types overlap.
Example Patient is scheduled off 06/21/2010 and 06/22/2010 for CaseType BHS. The patient is also scheduled off 06/21/2010 - 06/24/2010 for Medical.
My SQL would return 6 rows. 2 rows for the BHS and 4 rows for the Medical. Because 06/21/2010 and 06/22/2010 overlapped each other with both case types, I would expect to only see 4 days total off for this patient.
The fields involved for this calculation are as follows:
NumberOfDays
CaseType (Returns either the Medical or BHS)
ado.PFCDutyStatusID (Returns a patients duty status for the given case type - Sick, Limited or Full).
SINGLEDATE (Returns the individual day)
Right now I have a running total named "Days Total" thats set up as such:
Field to Summarize: ado.NumberOfDays
Type of Summary: Sum
Evaluate on change of field: ado.PFCDutyStatusID
Reset: Never
If I did not explain well enough or you have additional questions, please ask, I will try my best to answer. Thank you in advance for any help you can offer me.
A patient can present to the clinic for one of two case types: Medical or BHS. (BHS = Behavioral Health). A patient can also be treated by both case types on a given day. What I need to do is return a total number of days a patient was off sick for both case types and count the day as one day when the case types overlap.
Example Patient is scheduled off 06/21/2010 and 06/22/2010 for CaseType BHS. The patient is also scheduled off 06/21/2010 - 06/24/2010 for Medical.
My SQL would return 6 rows. 2 rows for the BHS and 4 rows for the Medical. Because 06/21/2010 and 06/22/2010 overlapped each other with both case types, I would expect to only see 4 days total off for this patient.
The fields involved for this calculation are as follows:
NumberOfDays
CaseType (Returns either the Medical or BHS)
ado.PFCDutyStatusID (Returns a patients duty status for the given case type - Sick, Limited or Full).
SINGLEDATE (Returns the individual day)
Right now I have a running total named "Days Total" thats set up as such:
Field to Summarize: ado.NumberOfDays
Type of Summary: Sum
Evaluate on change of field: ado.PFCDutyStatusID
Reset: Never
If I did not explain well enough or you have additional questions, please ask, I will try my best to answer. Thank you in advance for any help you can offer me.