Hi,
have the following code which makes two lists
a list for holtypeid =1 and a list for holtypeid =2.
i dont want two rs, so i goto the first record for
the second list using rs.movefirst so the loop starts again - which is fine as long as there are records for holtypeid =1 or 2 , else i get an eof error.
hope i make sense
sql
asp
have the following code which makes two lists
a list for holtypeid =1 and a list for holtypeid =2.
i dont want two rs, so i goto the first record for
the second list using rs.movefirst so the loop starts again - which is fine as long as there are records for holtypeid =1 or 2 , else i get an eof error.
hope i make sense
sql
Code:
sqlside= "SELECT CC.username, CB.bookst, CB.bookend, CC.userid, CB.holbookid, CB.holtypeid, holtype.holtypeimg "_
& "FROM holbook AS CB "_
& "LEFT JOIN user AS CC ON CC.userid = CB.userholid "_
& "LEFT JOIN holtype ON holtype.holtypeid = CB.holtypeid "_
& "WHERE manhol=" & 1 _
& " AND deptid=" & deptid _
& " AND ((cb.bookst BETWEEN '"&dstartdatesql&"' AND '"&denddatesql&"') "_
& "OR (cb.bookend BETWEEN '"&dstartdatesql&"' AND '"&denddatesql&"') "_
& "OR (cb.bookst <= '"& dstartdatesql& "') "_
& "AND (cb.bookend >= '"&denddatesql&"'))"
asp
Code:
Set RSside = Conn.Execute(sqlside)
<%' holiday quicklist
response.write "<br><img src = images/spacer.gif height=20>"
response.write "<div id=break></div>"
response.write "<table>"
response.write "<tr>"
response.write "<td><img src=""images/bookbuthol.gif""><span class = mfitsml>Holidays this Month</span></td>"
response.write "</tr>"
'rs.movefirst
Do while not rsside.eof
holtypeid = rsside("holtypeid")
if holtypeid = 1 then
employee = rsside("username")
bookst = rsside("bookst")
bookend = rsside("bookend")
response.write "<tr>"
response.write "<td>><span class=courtcarreg>"& employee &"</span></td></tr><tr><td class=mfitsml>"& bookst & " to " & bookend &"</td>"
response.write "</tr>"
end if
rsside.movenext
loop
response.write "</table>"%>
<%' training quicklist
response.write "<br><img src = images/spacer.gif height=20>"
response.write "<div id=break></div>"
response.write "<table>"
response.Write "<tr><td height =10></td></tr>"
response.write "<tr>"
response.write "<td><img src=""images/bookbuttrain.gif""><span class = mfitsml>Training this Month</span></td>"
response.write "</tr>"
'this line is the one i cant work out!!
if not (rsside.eof) then
rsside.movefirst
end if
Do while not rsside.eof
holtypeid = rsside("holtypeid")
if holtypeid = 2 then
employee = rsside("username")
bookst = rsside("bookst")
bookend = rsside("bookend")
response.write "<tr>"
response.write "<td><span class=courtcarreg>"& employee &"</span></td></tr><tr><td class=mfitsml>"& bookst & " to " & bookend &"</td>"
response.write "</tr>"
end if
rsside.movenext
loop
rsside.close
response.write "</table>"
response.write "<br><img src = images/spacer.gif height=20>"
response.write "<div id=break></div>"
%>