I have a fully functioning asp calendar on my Intranet (found it on this site). The purpose is to allow a user to click on a date and view the events for that day and 6 days after. I got that 90% working. Here is where I'm having trouble. Under the calendar I'm using response.write to display the date selected and the sixth day after.
ex.
10/20/2004 - 10/30/2004
Under this each date is listed separately with any events that fall on those dates.
ex.
10/20/2004
something
10/21/2004
something else
The selected date is passed through the URL using date as a variable. I started using the date function but it only wants to display the current date and what ever I add on to it.
response.write date + 7
The problem I am having is when I select a different day it only displays the current date + 7. The events are listed correctly but the dates above them still display the current + 7. I tried assigning the code to use the variable date (passed at the url) but it is looking at it as a string not a date. When I try to add 7 to it I get an error. Any idea how I can use the varaible date (passed at the url) to make this work? Thanks,
Code:<%response.write (request("date")) '& " " & "-" & " " & date + 7%> <br> </strong></p> <p> <% Dim curDate curDate = request("date") strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='c:\database\qa.mdb' ;Persist Security Info=False" set dbConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") Set objaRS = Server.CreateObject("ADODB.Recordset") dbConn.Open strConnect %> <% 'objRS.Close 'Close recordset 'Set objRS = Nothing 'Set recordset to nothing 'dbConn.Close 'Close Database connection 'Set dbconn = Nothing 'Set db connection to nothing %> <% 'Current Date response.write date & "<BR>" strSQL = "SELECT * FROM evtCalendar WHERE evtBDate='" & curDate & "'" objRS.Open strSql, dbConn Do Until objRS.EOF = True 'Displays results Response.Write "<BR>Event Name: " & objRS("evtName") Response.Write "<BR>Event Description: " & objRS("evtDescription") Response.Write "<P><HR><P>" objRS.MoveNext Loop %><BR> <% 'Current date plus one day curaDate = date + 1 response.write date + 1 & "<BR>" straSQL = "SELECT * FROM evtCalendar WHERE evtBDate='" & curaDate & "'" objaRS.Open straSQL, dbConn Do Until objaRS.EOF = True 'Displays results Response.Write "<BR>Event Name: " & objaRS("evtName") Response.Write "<BR>Event Description: " & objaRS("evtDescription") Response.Write "<P><HR><P>" objaRS.MoveNext Loop %><BR> <%response.write date + 2%><BR> <%response.write date + 3%><BR> <%response.write date + 4%><BR> <%response.write date + 5%><BR> <%response.write date + 6%><BR> <%response.write date + 7%><BR>


Reply With Quote
Bookmarks