Groups | Blog | Home
all groups > sql server reporting services > november 2004 >

sql server reporting services : Table counting column



Cindy Lee
11/5/2004 3:23:36 PM
Is there a way in a table to just have a counter in a column, of which row
number.

data1 data2 1
data1 data2 2
data1 data2 3
data1 data2 4
data1 data2 5

that will count like 1,2,3,4,5

Rodney Landrum
11/5/2004 7:41:16 PM
Hi Cindy,
Yes, there is a function that you can use in an expression for the row count
column.
The function is called RowNumber. By putting this in an expression like:
=RowNumber(Nothing)
it will autimoatically count for each row despite any grouping you may have.
If you want to start the count over again you can use a different Scope such
as a group name. Like:
=RowNumber("GroupName")

Remember to use quotes. This will output like:
Group 1
1
2
Group 2
1
2
3
Hope this helps. there is also a CountRows() function that will give an
overall count of rows for a scope.
-
Rodney Landrum
Author, "Pro SQL Server Reporting Services" (Apress)
http://www.apress.com

[quoted text, click to view]

AddThis Social Bookmark Button