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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Selection Statement

Status
Not open for further replies.

ChipsAhoy

Technical User
Nov 27, 2002
33
0
0
US
I am trying to calculate the number of visits per patient, but I only want to include patients that have a total of more than 4 visits. Therefore, I need to select all visits for all patients, add the visits to get a total per patient and then evaluate whether the total exceeds 4. I then want to select only those patients with 4 or more visits for inclusion in my report.

How can this conditional selection process be accomplished?
 
A shame you didn't bother to post what software, version, and the database being used. Technical information should be a part of EVERY post about any software.

To limit the output display to only those with more than 4 vists each, group the report by the patient, and in the Report->Selection Formulas->Group place:

count({table.visit},{table.patient}) > 4

This will be processed by crystal, however keep in mind that all rows are still in the report.

It would be better to have done this on the database using a View or Stored Procedure.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top