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!

count with groupby

Status
Not open for further replies.

Aleathiel

Technical User
May 13, 2005
21
CA
Is there a way to do a count that only count 1 time identical data on a report? Its been some time I'm trying, I can do it with another table but the time to get the report is like 2 time longer, so Im trying to find a code that would do that and would not take a longer time to get the report.

Thanks
 
Do the distinct count with an ID in one query and then with another query link to the first query and add the count in.
 
Alethiel
Here is another way, in case you want to show all the records.

In your report, put a Group Footer, with an unbound text box that has the expression below. For this example, I am calling the text box txtCount1
=IIf(Sum(Abs([YourRecordID]))>1,1,1)

Put another unbound text box...let's call it txtCount2...that has the expression
=txtCount1 and make that text box a Running Sum OverAll.

In your report footer, put an unbound text box...let's call it txtTotalCount...with the expression
=txtCount2

You will want to make the text boxes in the Group Footer invisible, and make that section smaller if you don't need it otherwise.

Tom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top