Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts

    loop through dates

    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?

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Try this:
    Code:
    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
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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