October 11, 2011 at 7:49 am
Hi,
I am trying to add total row count to an existing report which the result sets are based on executing SP (the SP use table variable to process complicate join with multiple tables and with some case statement, the reports is order based on the case statement) the last statement on SP is select from the table variable to get report result which populated back into report. How can i add row count in this situation ?
October 11, 2011 at 8:30 am
I would try a couple of different options.
First, you could add a Row_Number() to the query and look for the last or max value of that column.
Or, put the value of a row count query to your SP (SELECT @RowCount = COUNT(*) FROM yourTablehere) and then add the @RowCount variable as a column to your final output.
October 11, 2011 at 9:39 am
Thank you for the input, adding a row_count / hide it and get max of the value seems working perfect for me and a lot less work.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply