Ciao,
hai provato con:

rs1.source = select codice, count(*) as num from <tabella> group by codice;

e poi

<%=rs1.fields.item("num").value%>

Ciao,