"TomB" wrote:
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",currentMond ay,4))
incrementingMonday=currentMonday
do while incrementingMonday<endingFriday
Response.Write vbTab & _
"<option value=""" & incrementingMonday & """>" & _
incrementingMonday & " - " & _
DateAdd("d",4, incrementingMonday) & _
"</option>" & vbCrLf
incrementingMonday=DateAdd("d",7,incrementingMonda y)
Loop
Response.write "</select>"
%>
"Mike D" <Mi***@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com... I need to provide a pulldown with work weeks displayed. Is there any easy
way to do this?
I would like to go 6 months from the current date and show a week as Oct.
11 - 15. Which is Monday to Friday.
Any help appreciated.
Mike
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