September 21, 2007 at 7:27 am
Hi,
I have a report that prints out all records in a table for that day, I'd like to add a count in my query of all rows displayed in the report. After reading online the Countrows function seemed like it would be the best way to go about this. However; I'm having trouble comprehending how the countrows function works. The MSDN site gives the following function template:
CountRows(Scope)
(String) The name of a dataset, grouping, or data region that contains the report items to which to apply the aggregate function. If Scope is specified, the aggregate function applies to all data in the dataset, grouping, or data region. For more information about the Scope parameter, see Using Report Functions in Expressions (Reporting Services).
I'm still not sure what it requires as an argument (scope) if my PK is ID and I want to do a count on ID do I use the countrows function to do that, or is there a better way to do a count of records in my report?
September 24, 2007 at 9:30 am
You simply put the name of your dataset or group in place of SCOPE. This will return the number of rows in the dataset or group. You do not need to specify the PK.
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgSeptember 24, 2007 at 9:55 am
I can't really tell if you want to put the count in the query or the report. The description that you provided is for a function in reporting services. If you want to put a count into your query, you can do count(*) [number of rows returned], count(ID) [number of rows with a value in the ID column], or count(distinct id) [number of unique ID values returned]
Hope this helps
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply