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!

Records that fall within Different Time criteria Simultaneously?

Status
Not open for further replies.

jaybar48

Technical User
Feb 16, 2002
61
US
I want to select patients who had two or more medical visits within the past year AND at least one of the visits must be within the last 6 months.

I use record selection with date parameters to select patients with medical visits during the last year. I then use running totals (distinctcount) with formula evaluation to get the number of patients who had 2 or more visits in the last year.

That was fairly easy.

Either using record selection, group selection, running totals etc., how can I further limit the report to show those patients who had two or more visits during the last year AND at the same time had at least one visit during the last six months?

each visit record had a client.ID and visit date field.

Thanks in advance,

Jay
 
Group by the patient.

In the Report->Edit Selction Formula->Record place something like:

{table.visitdate} >= dateadd("yyyy",-1,currentdate)

In the Report->Edit Selction Formula->Group place something like:

maximum({table.visitdate},{table.patient}) >= currentdate-182
and count({table.visitdate},{table.patient}) >= 2

Keep in mind that this suppresses the rows, you'll need to qualify any running totals with the same date criteria in the evaluate use a formula to get accurate numbers.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top