Håller på med ett relativt omfattande statistik-script. Har stött på ett litet problem när jag vill visa per veckodag hur många sidvisningar jag haft.
Här är min kod:
<%
For i = 1 To 7 Step 1
Set CntRS = Conn.Execute("SELECT COUNT(*) AS antal FROM stats WHERE WeekDay(datum,2) = " & i)
Select Case i
Case "1" %><td>Måndag:</td><%
Case "2" %><td>Tisdag:</td><%
Case "3" %><td>Onsdag:</td><%
Case "4" %><td>Torsdag:</td><%
Case "5" %><td>Fredag:</td><%
Case "6" %><td>Lördag:</td><%
Case "7" %><td>Söndag:</td><%
End Select
%>
<td>
<%
If CntRS.EOF Then
Response.Write(0)
Else
Response.Write(CntRS("antal"))
End If
%>
</td>
</tr>
<%
CntRS.Close : Set CntRS = Nothing
Next
%>
Är det någon som kan hjälpa mig?
Felmeddelandet jag får är följande:
[MySQL][ODBC 3.51 Driver][mysqld-4.1.7-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2) = 1' at line 1