Technically if you have a select statement with SELECT TOP N... in place, the datasource and the repeater will only ever return that value or less. So you need to have another query run to do a count on all the items you're looking for.