I am trying to list last visits per hour in last 24 hours. I thought the following code would do it, but I get the outcome below. Any idea where I screwed it up?
[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],[,0],
Dim ListHours()
HoursInCurrentDay = "24"
Redim ListHours(HoursInCurrentDay)
For Days = 0 To 23
ListHours(Hours) = Hours
Next
SQLARR2 = ListHours
For x = 1 to ubound(SQLARR2)
SQL = "SELECT COUNT(DISTINCT VISITORIP) AS TOTALVISITS"
SQL = SQL & " FROM STATS"
SQL = SQL & " WHERE DATEPART(hh, GETDATE()) = '"& SQLARR2(x) &"' AND DATEENTERED BETWEEN CONVERT(VARCHAR(10), GETDATE()-1, 101) AND CONVERT(VARCHAR(10), GETDATE(), 101)"
Set objVisits = objConn.Execute(SQL)
If objVisits.EOF Then
Else
List = List + "[" & SQLARR2(x) & "," & objVisits("TOTALVISITS") & "],"
End If
Next
Response.Write List