Can someone help me get this right? I'm trying to count the number of records in a SELECT but I'm doing something wrong - the result is just "". TIA! - David Cook
If Rally = "Russia" Then
SQLStmtC = "SELECT Count(*) As Cnt FROM stimes2 WHERE Name = '" & Name & "' AND Model = '" & Model & "' AND Rally = '" & Rally & "' GROUP BY Name, Model, Rally "
Set RS = Connection.Execute(SQLStmtC)
If Cnt = "" Then
Response.Write "TEST"
End If
If Cnt = 8 Then
Rtime = "SELECT * from stimes2 WHERE Name = '" & Name & "' AND Model = '" & Model & "' AND Rally = '" & Rally & "' GROUP BY Name, Model, Rally"
SQLStmtD = "Insert Into rtimes (Rtime) "
SQLStmtD = SQLStmtD & "VALUES ('" & Rtime & "') WHERE Name = '" & Name & "' AND Model = '" & Model & "' AND Rally = '" & Rally & "'"
' Set RS = Connection.Execute(SQLStmtD)
End If
End If
If Rally = "Russia" Then
SQLStmtC = "SELECT Count(*) As Cnt FROM stimes2 WHERE Name = '" & Name & "' AND Model = '" & Model & "' AND Rally = '" & Rally & "' GROUP BY Name, Model, Rally "
Set RS = Connection.Execute(SQLStmtC)
If Cnt = "" Then
Response.Write "TEST"
End If
If Cnt = 8 Then
Rtime = "SELECT * from stimes2 WHERE Name = '" & Name & "' AND Model = '" & Model & "' AND Rally = '" & Rally & "' GROUP BY Name, Model, Rally"
SQLStmtD = "Insert Into rtimes (Rtime) "
SQLStmtD = SQLStmtD & "VALUES ('" & Rtime & "') WHERE Name = '" & Name & "' AND Model = '" & Model & "' AND Rally = '" & Rally & "'"
' Set RS = Connection.Execute(SQLStmtD)
End If
End If