TomB said:
There's probably a better solution, but this should work.
<%
Response.write "<select name=""week"">" & vbCrLf
Dim currentMonday
Dim incrementingMonday
Dim endingFriday
currentMonday=DateAdd("d",Date, Weekday(Date)-6)
endingFriday=DateAdd("m",6,DateAdd("d",currentMonday,4))
incrementingMonday=currentMonday
do while incrementingMonday<endingFriday
Response.Write vbTab & _
"<option value=""" & incrementingMonday & """>" & _
incrementingMonday & " - " & _
DateAdd("d",4, incrementingMonday) & _
"</option>" & vbCrLf
incrementingMonday=DateAdd("d",7,incrementingMonday)
Loop
Response.write "</select>"
%>
This is what I did. I was hoping for a simpler solution but it wasn't too
bad after all.
Function DisplayDatePulldown()
Dim datToday, datEndTimePeriod
Dim intDaysSinceMonday, datLastMonday
Dim x, datLoopDate, strOut
datToday = Date()
intDaysSinceMonday = -Weekday(datToday) + 2
datLastMonday = DateAdd("D", intDaysSinceMonday, datToday)
datEndTimePeriod = DateAdd("M", 6, datLastMonday)
strOut = "<select size=""1"" name=""WeekOf"">"
strOut = strOut & "<option>Select Week</option>" & "<br>"
For x = 0 to DateDiff("w", datLastMonday, datEndTimePeriod, 2)
datLoopDate = DateAdd("WW", x, datLastMonday)
strOut = strOut & "<option Value=" & Chr(34) & datLoopDate & Chr(34) & ">" & _
UCase(MonthName(Month(datLoopDate), True)) & ". " & _
Day(datLoopDate) & " - " & Day(datLoopDate) + 4 & "</option>" & "<br>"
Next
DisplayDatePulldown = strOut & "</select>" & "<br>"
End Function
Thanks for you reply
Mike