Hi. I have a problem creating underline code require to create a 2 dimensional array that is basically a count.
I have 2 tables. portals and referals. each portal has a referal against it.
I wish to count the number of different referals for each portal.
Could someone please help me with this.
I originaly thought that I should pick up the different types of referal and write to an array ('get referals) and then step through the portal recordset and update the matching referal element in the array with +1 each time a matching referal is found in there portal recordset.
Im completely lost in doing this though not fully understanding how I manipulate the array.
My attempt to coide this has failed obviously with gaps. If someone could help me with this it would be much appreciated.
Code:
sub getStats()
'get the referals
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM referals"
RS.Open strSQL, Conn
arrayCol=0
arrayRow=0
RS.MoveFirst
do while not RS.EOF
myArray(arrayRow, arrayCol)=RS("referal")
arrayRow=arrayRow+1
RS.movenext
loop
'get the portal here and then step through array and update a total
set RS=nothing
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM comments where portal="request.queryString("portal")
RS.Open strSQL, Conn
RS.MoveFirst
do while not RS.EOF
RS.movenext
loop
end sub
|