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 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DatePart question

    Hi,

    I have this code that I want to change from day to weeknumber:

    Code:
    <% Response.Write "<img src=""img/" & day(now) & ".gif"">" %>
    but I have not had any luck so far so now I hope someone could help me.

    /Speedy

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    This?

    <% Response.Write "<img src=""img/" & Weekday(Now) & ".gif"">" %>

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    And for more date ideas:

    Could I get a little help with dates? - 8/15/2000
    http://www.aspfaq.com/faq/faqShow.asp?fid=52

    Dates & Times - Usage & Formatting by Darryl Fosbery - 7/15/2000
    http://www.asp-help.com/articles/dates.asp
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  • #4
    Regular Coder
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I solved it like this:

    Code:
    <% Response.Write "<img src=""Tutorials/Banner/" & Year(Now()) & "/" & DatePart("ww", Now, vbMonday, vbFirstFourDays) & ".gif"">" %>
    /Speedy


  •  

    Posting Permissions

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