Using Count to display total at top of page prior to detail section

MikeM670
MikeM670 used Ask the Experts™
on
Crystal Reports 2016 SP4

I wish to display a count of records based on a certain criteria at the Top of the report before the detailed listing.  Is it appropriate to use the Count() function to accomplish this.

SQL Columns

Location   Trustee
A Block          N
A Block          Y
B Block          Y


So in this case I wish to display the count of  all Records where Trustee  is "Y".

Count of Trustee:  2
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
The only option you have with COUNT is to count all records or count the non-null records.

YOu can accomplish what you want with a formula

Name - YesTrustee
If {TrusteeField} = 'Y' then
    1
ELse
    0

Open in new window


YOu can then use a summary SUM on that to get the count

SUm({@YesTrustee})

Open in new window


mlmcc

Author

Commented:
Worked perfectly.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial