Displaying a list of dates

Results 1 to 2 of 2

Thread: Displaying a list of dates

  1. #1
    Join Date
    Dec 1969

    Default Displaying a list of dates

    The form that I did is this way:<BR>It has a Start Date and End Date field<BR>So, if I choose Start Date: 06/07/2002<BR>End Date: 12/07/2002<BR><BR>When I click Submit, I want it to display a list of dates in a table :<BR>6/7/2002<BR>7/7/2002<BR>8/7/2002<BR>.<BR>.<BR>. until<BR>12/7/2002<BR><BR>A problem probably starts if Start date is in one month and end date in another month. I don&#039;t know how to code that.<BR>How can i do that??

  2. #2
    Join Date
    Dec 1969

    Default Research..

    ...the date handling functions. Specifically DateAdd() and DateDiff(). Follow the link on the left to "VBScript Reference".<BR><BR>You want something like<BR>&#060;%<BR>If DateDiff("d", StartDate, EndDate) &#060; 0 then<BR> &#039; They chose a start date after the end date<BR> &#039; Die somehow<BR> Response.End<BR>End If<BR>Do While DateDiff("d", StartDate, EndDate) &#062; 0<BR> StartDate = DateAdd("d", StartDate, 1)<BR> Response.Write Day(StartDate) & " " & MonthName(Month(StartDate)) & " " & Year(StartDate) & "&#060;br/&#062;"<BR>Loop<BR>%&#062;<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts