RSS Forums RSS
Please support our ASP advertiser: Lunarpages ASP Web Hosting

Help with a date loop & error '80020009'

Join Date: Apr 2007
Posts: 4
Reputation: mtarby is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mtarby mtarby is offline Offline
Newbie Poster

Re: Help with a date loop & error '80020009'

  #5  
Apr 23rd, 2007
Thanks - I ended up going a different route, which works but revealed another problem. Now I'm seeing multiple dates, but my sort order gets messed up because the recurring events are kept together.
<%
Dim astrastart, astraend
astrastart = request.Form("startmonth")& "/"  & request.Form("startday") &  "/" & request.Form("startYear")
astraend = request.Form("endmonth")& "/"  & request.Form("endday") &  "/" & request.Form("endYear")
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT  astra.EVNTINST.START_DATE, astra.EVNTINST.ID, astra.EVNTINST.START_TIME, astra.EVNTINST.NAME as [MEETING NAME], astra.EVNTINST.END_DATE, astra.EVNTINST.END_TIME, astra.EVNTINST.BUILDING, astra.EVNTINST.ROOM,  astra.EVENTREC.EVENT_NAME, astra.EVENTREC.EVENT_STATUS, astra.EVENTREC.EVENT_TYPE, astra.EVENTREC.CONTACT  FROM  astra.EVNTINST INNER JOIN astra.EVENTREC ON astra.EVNTINST.GROUPID = astra.EVENTREC.ID  WHERE astra.EVNTINST.BUILDING <> 'vans' AND astra.EVENTREC.EVENT_TYPE <> 'Exam' and astra.EVENTREC.EVENT_TYPE <> 'Review class' and astra.EVENTREC.EVENT_TYPE <> 'test' and convert(datetime, astra.EVNTINST.START_DATE)  >= '" & astrastart & "' AND convert(datetime, astra.EVNTINST.END_DATE) <= '" & astraend & "' order by convert(datetime, astra.EVNTINST.START_DATE), convert(datetime, astra.EVNTINST.start_time), astra.EVNTINST.id desc"
 
cn.Open ("Provider=sqloledb;Data Source=mssql;Initial Catalog=xxxxx;User Id=xxxxx;Password=xxxxx;")
rs.Open sql, cn
response.write "<link rel=""stylesheet"" href=""/style/normal.css"">"
response.write "<table class=""regsmall"" border=""1""  cellpadding=""5""><tr><td colspan=""6""><h3>Events Taking Place Between " & astrastart & " and " & astraend & "</h3></td></tr><tr><th>Date & Time</th><th>Event Name</th><th>Location</th><th>Status</th><th>Event Type</th><th>Contact</th>"
    Do While NOT rs.EOF
    mname = rs("MEETING NAME")
    mbuilding= rs("building")
    mroom=rs("room")
    mcontact=rs("contact")
    mstatus=rs("event_status")
    mtype=rs("event_type")
    mtime = rs("start_time") & " - " & rs("end_time")
    For thisdate = CDate(rs("START_DATE")) To CDate(rs("END_DATE"))
%>
    <tr>
        <td><strong><%=thisdate%></strong><br/><%=mtime%></td>
        <td><%=mname%></td>
        <td><%=mbuilding%> &nbsp; <%=mroom%></td>
            <td><%=mstatus%></td>
                <td><%=mtype%></td>
        <td><%=mcontact%></td>
    </tr>
<%
    Next
    rs.MoveNext
Loop
rs.Close
%> 
</table>

Is there a way to make sure the sort doesn't get ignored?
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:16 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC