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

Only count a record once 1

Status
Not open for further replies.

jemsmom

IS-IT--Management
May 31, 2005
43
US
Using Crystal XI on a SQL Server database my report displays the number of patients, number of results and the average as well as the standard deviation of a patients blood sugar results by patient, department and for the report. I also need to count the number of patients that had a result that was <= 50 and <= 70 and >= 140 with the patient only counted once even if they had multiple results that met this criteria.
How do I only count the result once if the patient has multiple results that meet this criteria?

An example patient result is:
Patient 1:
48
69
52
120
135
170
I need the counts to be <= 50 = 1 < 70 = 1 >=140 = 1
 
You could use running totals that did a distinctcount of patient, with an evaluation formula, e.g.,

{table.result} < 50

Reset on change of group if you want the count at a group level, or never, if at the report level.

-LB
 
Once again LB you have solved my problem. Thank you - I appreciate your time and effort.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top