...

View Full Version : loop through dates



esthera
01-25-2007, 02:32 PM
how can I loop between 2 dates.
meaning say 12/12/2006 to 1/20/2007 if I wanted to loop through all the days saying the day? can you do this in a loop?

glenngv
01-25-2007, 04:28 PM
Try this:

fromDate = #12/12/2006#
toDate = #1/20/2007#
dt = fromDate
while datediff("D", dt, toDate)>=0
response.write dt & " - " & weekdayname(weekday(dt)) & "<br />"
dt = dateadd("D", 1, dt)
wend



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum