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

How to count records

Status
Not open for further replies.

Machlink

Technical User
Apr 3, 2004
25
CA
I have a Mpitems.no consists of DP,ST,PM records. I want count no of DP in mpitems.no field which is grouped by mpitems.no field.

Thanks in advance
 
Right Click on the mpitems.no field and choose Insert -> Summary - - then make sure you choose "Count".

Cheers,

paulmarr
 
Or you could use a running total. If you use running totals, they are working out at the same time as the Crystal report formats the line. This means you can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.
If you use summary totals, they are taken directly from the data and can be shown in the header. They can also be used to sort groups, or to suppress them.

It helps to give your Crystal version, since newer versions have extra options, and some extra problems. I use Crystal 8.5

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
I have want to count no of DP,St,pm in mpitems.no field. Any formula help would be appreciated.

Thanks in advance
 
Try:

if {table.field} = "DP" then 1

Right click on this formula and insert a summary (SUM, not count). Create separate formulas for "ST" and "pm", and insert sums on them at the group and grand total levels.

You could also use running totals (a separate one for each), specifying in the evaluate based on a formula area:

{table.field} = "DP"

Reset on change of group.

However, running totals generally are slower than using formulas, and you would have to create separate ones if you also want grand totals.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top