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

Counting the appearances of a field...

Status
Not open for further replies.

JoshYeadon

Technical User
Sep 29, 2009
3
GB
Right,

I have 2 tables linked together in the same report.
Table one contains all the payments made to the company as Fees.
Table two contains all the disbursements made to the creditors.

When i try to count to Fee Payments & the Disbursements seperately...i get a grand total of the 2 combined. I cant seem to count them seperately.

I have moved everything into the Group Header & created a formula for each which looks like...

Count (Fees.When,Client.Ref)
&
Count (Disbursement.When,Client.Ref)

Both come up with the total of the two combined. Any idea how to count them seperately?

Thanks
 
several things come to mind but first try using distinct count instead of count. You may have to use a transaction number field or something similar instead of fees. Not knowing what unique fields you have available I would try

distinctcouont({transaction_ID},Client.Ref})








_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
How do you distinguish fees and disbursements? Please show some sample data at the detail level, labelling each field using the convention {table.field}, for several rows of data. You probably need to use running totals or conditional formulas to do the counts.

-LB
 
Thanks guys,

I used the "distinctcouont({transaction_ID},Client.Ref})" formula and this worked absolutely fine.

I was missing the distinct count and the ID field as some dates were the same, meaning when i used the .when, it counted them incorrectly.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top