ASP- Function with db

I’m trying to make an event archive.

i have it so it finds all the distinct years. but ineed it to find how many events are in each year.

heres what i have

 <%Do While not RSyear.eof%>
			<div class="asset" <%if Request.QueryString("year") = RSyear("item_year") then%>id="key"<%end if%>><%= RSyear("item_year")%>(<%= yearcount(RSyear("item_year"))%>)</div>
			<%RSyear.MoveNext
			Loop
			RSyear.Close
			set RSyear = nothing%>

And this is the function i made(my first attempt using functions)

Function yearcount(var)
	Set RSyearcount = Server.CreateObject("ADODB.Recordset")
	RSyearcount.Open "SELECT item_year FROM events WHERE item_year=" & var & "", Conn, 1, 1
	Response.Write RSyearcount.recordcount
	RSyearcount.Close
	Set RSyearcount = nothing
End Function

thanks for any help,
-Naaman