i have a dataset with a field called TYPE. The data contains 3 different types, "A", "B" and "C".

I would like to use Crystal Reports to count how many records are of type "A", how many of type "B" and how many of type "C". The field is a string so simply TYPE = "C" will tell me if it is type "C".

Crystal Reports has a Set of Summary functions available in the Formula Editor. One of the functions is Count() which counts the number of records. The parameters are

Count(fld), Count(fld,condFld) or Count(fld,condFld,value).

Is there any way to do this. I tried making a new formula field called TYPEAT such that

if TYPE="A" then

formula = true

else

formula=false

end if

then I tried a second formula field typeac

count(TYPE,TYPEAT)

Thinking that TYPEAT IS NOW A CONDITIONAL FIELD. The formula editor will not accept this.

I can use parameter fields and perform the calculations in the main program, but i would like to use a conditional count formula.

Can this be done with Crystal Reports????

Have you tried right clicking the field

Click INSERT --> SUMMARY

Can you insert a summary?

To summarize on a condition field it needs to be a group in the report.

Another way to do this would be

if TYPE="A" then

formula = 1

else

formula=0

end if

You can then insert a summary as a sum to get the count.

mlmcc