Returning Previous Months

Results 1 to 2 of 2

Thread: Returning Previous Months

  1. #1
    Join Date
    Dec 1969

    Default Returning Previous Months

    Hi, I am trying to generate a drop down menu with a series of dates in it, starting with the Current month and year and going back 12 months, i.e. Starting with "April 2002" going back to "May 2001". Is there any way of doing this using the standard date formatting, I have looked everywhere and cannot see a way of doing this - the only way I can think of is taking 30 days away from the date, which wont always be accurate.<BR><BR>I hope someone can help me :)<BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Returning Previous Months

    response.write "&#060;select name=&#039;dates&#039;&#062;"<BR>for i = 0 to 11<BR> pm = dateadd("m",-i,date())<BR> response.write "&#060;option value=" & pm & "&#062;" & monthname(month(pm)) & " " & year(pm)) & "&#060;/option&#062;"<BR>next<BR>response.write "&#060;/select&#062;"

Posting Permissions

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