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

Count a field subject to a condition

Status
Not open for further replies.

Katy44

Technical User
Dec 12, 2003
723
GB
Hi,
I am using Crystal 9.
I have inserted summary fields to count the number of records in my report. I then want another summary field alongside to show the number of records where a particular field has the value 1.
I can think of two ways of doing this: first to group by this field, choose to customise my groups, have one group for the "1" records and group all the others together and then put a count on the group headers.
The other way would be to create a formula to output 1 if the value of the field is "1", or zero otherwise, and then sum on this.
These are both fine, and I assume they would work, but they seem a very roundabout way of doing something very simple. Am I missing something obvious?
 
No, your not missing anything obvious. The options you have shown are the easiest.

Reebo
UK

Please Note - Due to current economic forcast and budget constraints, the light at the end of the tunnel has been switched off. Thank you for your cooperation.
 
OK, thank you. I have done it the second way.
I would have thought there would be a conditional sum, conditional count etc option, where you insert a summary for records that meet your specified criteria. Oh well, thanks for your help.
 
That would be a running total, which would also work.

Reebo
UK

Please Note - Due to current economic forcast and budget constraints, the light at the end of the tunnel has been switched off. Thank you for your cooperation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top