| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Cany anyone help with this script please
The script is as follows
<% @LANGUAGE = VBScript %> <% Option Explicit Response.Expires = 0 %> <!-- #include file="constants.asp"--> <% Dim objRS, strQ, datCurrent, datList, datList2 datCurrent = Date() datList2 = DateAdd("d" , -1 , datCurrent) datList = DateAdd("d" , +30 , datCurrent) strQ = "SELECT * FROM dates WHERE entry_date >#" & datList2 & "# AND entry_date <#" & datList & "# ORDER BY entry_date ASC" Set objRS = objConn.Execute(strQ) %> <!-- #include file="../template/template.htm" --> <!-- #include file="menu.asp" --> <div id="divContent"> <% Response.Write " The date today is " & datCurrent & " The items listed here are from after " & datList2 & " until " & datList While Not objRS.EOF Response.Write ContTable Response.Write "<tr><td>" Response.Write "" & objRS("entry_date") & " " Response.Write "<a href=""viewdiary.asp?code=" & objRS("entry_id") & " "" class=""menu"">" Response.Write "<font color=""#ff0000"">" & objRS("entry_name") & "</font></a>" Response.Write " " & objRS("entry_location") & "<br></td></tr>" Response.Write "<tr><td bgcolor=""#f6f6f6"" align=""center"" valign=""middle"">" Response.Write "" & objRS("entry_description") Response.Write "</td></tr><tr><td align=""right"">" Response.Write "<a href=""viewdiary.asp?code=" & objRS("entry_id") & " "">" Response.Write "<font color=""#ff0000""> Click here for further details</font></a>" Response.Write "</td></tr></table>" Response.Write "<img src=""../images/buttons/rule.gif"" " & RuleSize & ">" objRS.MoveNext Wend objRS.close objConn.close Set objRS = Nothing Set objConn = Nothing Response.Write Copy Response.Write "</td></tr></table>" %> </div> The results are as follows, Can any one tell me why? I have tried using between but it made no difference. This works for a bit then starts giving me the result below. and then I want to throw myself down a sewerage pipe. Please help. See the dates, Why are the older dates still appearing. The date today is 04/12/2004 The items listed here are from after 03/12/2004 until 03/01/2005 17/11/2004 VLU Barberton-tak Vergadering Barberton Die VLU Barberton-tak hou sy volgende vergadering of Nov 17 by die Hervormde Kerk om 9:00Click here for further detailshttp://www.webtech.co.za/lowveldnet...uttons/rule.gif 17/11/2004 VLU Eden-tak Vergadering Eden Nelspruit Die VLU Eden-tak hou sy volgende vergadering of Nov 17 by die Schoemanskloof Boeresaal. Onthou om eetgoed en R20 se uitruilgeskenk to bringClick here for further detailshttp://www.webtech.co.za/lowveldnet...uttons/rule.gif 18/11/2004 Red Riding Hood - A Modern Wolf Tale Sabie Red Riding Hood - A Modern Wolf Tale will be presented by ACTS at the Glynn Hall Theatre. Show starts 17:30 for 18:00, tickets available from Sabie Stationers & Tangles Hair Salon cost R30 adults & R15 children.Click here for further detailshttp://www.webtech.co.za/lowveldnet...uttons/rule.gif 18/11/2004 VLU Loerie-tak Vergadering Loerie Nelspruit Die VLU Loerie-tak hou sy volgende vergadering of Nov 18 by die Zuma Gastehuis by Columbusstraat om 09:30. Koste beloop R30 en bring n uitruilgeskenk van R30 saamClick here for further detailshttp://www.webtech.co.za/lowveldnet...uttons/rule.gif 19/11/2004 Red Riding Hood - A Modern Wolf Tale Sabie Red Riding Hood - A Modern Wolf Tale will be presented by ACTS at the Glynn Hall Theatre. Show starts 19:00 for 19:30, tickets available from Sabie Stationers & Tangles Hair Salon cost R30 adults & R15 children.Click here for further details and so on untill 05/12/2004 Holistic Fair Nelspruit Circle of light holistic fairClick here for further detailshttp://www.webtech.co.za/lowveldnet...uttons/rule.gif 09/12/2004 Spanish Evening White River La Luz Studio of Spanish Dancing will hold a Spanish evening at the Meating Place in White River. It will include Spanish dancing, a three-course Spanish meal & music. Tickets cost R70 (pre-booked) or R80 (at the door). Booking is essential.Click here for further details |
|
#2
|
||||
|
||||
|
not that any one cares but i solved
the problem like this
Dim objRS, strQ, datCurrent, datList, datList2, entrydate datCurrent = Date() datList2 = DateAdd("d" , -1 , datCurrent) datList = DateAdd("d" , +30 , datCurrent) If isDate(datCurrent) Then datCurrent = CDate(datCurrent) End If If isDate(datList) Then datList = CDate(datList) End If strQ = "SELECT * FROM dates WHERE entry_date >= #" & datCurrent & "# ORDER BY entry_date ASC" Set objRS = objConn.Execute(strQ) While Not objRS.EOF If isDate(objRS("entry_date")) Then entrydate = CDate(objRS("entry_date")) End If If entrydate >= datCurrent AND entrydate <= datList Then Response.Write ContTable Response.Write "<tr><td>" |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Cany anyone help with this script please |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|