searching for occurrence in database
freezer86 | Posted 8:36pm 17. February 2008 Server Time |
hi i'm new to asp, i got this prob wyl working hope someone could help...
i have a to search every occurence of "i" - this should be from 10 - 15, in the field "ConNo" and if i found it i will hve to get the "date" and "status" the date should be the newest date entered in the db that's y i compare it to the data in the "Date" field I had set the " det" value to 1/1/1900, but it seems that it wont exit the loop.. Am I doing it right? I think not..=(
=====================================================
-my code goes like this:
i=10
Do while not rs.EOF
while i <= 15
if rs("ConNo") = i then
if rs("Date") > det then
det = rs("Date")
if rs("Time") > tym then
tym = rs("Time")
Response.Write("<tr >")
Response.Write("<td >"& " " &"</td>")
Response.Write("<td align='center'> "& rs("ConNo") &"</td>")
Response.Write("<td align='center'> "& rs("Status") &"</td>")
else
tym = tym
End if
Else
det = det
tym = tym
End If
i = i + 1
Else
i = i
End if
wend
rs.MoveNext
Loop
rs.close
ado.close
set ado=nothing
set rs=nothing
=================================================== |