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!

Need help with formula to sum where field is distinct 1

Status
Not open for further replies.

brendasql

Programmer
Apr 1, 2003
58
US
Hello -
I need assistance with a subreport. I can have multiple clients per companies and mulitple companies per county. I am able to get my distinct count of both the companies and clients by county but I am unable to sum the contacts that were made within the a set timeframe.
Example of data
County Company Client #days Since Contact
Dale ABC Smith 7
Dale ABC Jones 7
Dale XYZ Jackson 7
Dale A-1 Jenkins 10

The results that I need.....
County #Companies #Clients #CompanyContacts(last7days)
Dale 3 4 2

Can anyone help...the # of company contacts is the part that I am having problems getting to work.

Thanks!
 
Use a running total that does a distinctcount of company, and evaluates using a formula:

{table.date} >= currentdate-7

Reset never. Place the running total in the report footer.

-LB
 
Thanks LBass, but this only gives me the grand total. I need this count per county level as well. Any other suggestions?
 
I wanted to update you on the status of this. Thanks to LBass's suggestion I was able to figure out the solution. I created 2 Running Totals, the first was a SubTot on companies - distinct count and evaluate using formula and then RESET on change of Group - COUNTY. This runing total I placed in the Groupfooter with my other summaries. Then the second on was exactly as LBass stated and it took care of my grand totals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top