Essentially, get the first Friday, then add 7 to the date until the end of
the year
<%
Dim firstDay
Dim firstWeekDay
Dim firstFriday
Dim everyFriday
firstDay = DateSerial(1, 1, 2004)
' Assuming Sunday is the first day of the week
firstWeekDay = WeekDay(firstDay, vbSunday)
' Compute the date of the first Friday
If vbFriday >= firstWeekDay Then
firstFriday = firstDay + (vbFriday - firstWeekDay)
Else
firstFriday = firstDay + (vbFriday - firstWeekDay) + 7
End If
everyFriday = firstFriday
' Now that you have the first Friday, loop until you hit the end of the year
Do While Year(everyFriday) = 2004
Response.Write("<br>" & everyFriday)
everyFriday = everyFriday + 7
Loop
%>
--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"michaaal" <re******@verizon.net> wrote in message
news:O2****************@TK2MSFTNGP12.phx.gbl...
How can I get a list of the date of every friday of the year?
I realize this code is wrong, but maybe you'll see what I am after...
Sub GetFridayList()
For x = 1 to len(Date(2004))
if Date(2004,x)="Friday" then msgbox (Date2004)
Next
End Sub