#1
  1. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    303
    Rep Power
    16

    Question Show image based on date range


    All I want to do is display an image if the current date is within a range or show the default image if not. For instance, over Easter I might want to show a bunny, else show the default image. Eventually I might have several image to display for various date ranges - else show default. I guess it's a bit like Google's logo.

    I thought this would be quite simple but my code doesn't seem to be working?

    Here is my code:
    Code:
    <% if Date() => "27/4/2006" AND Date() <= "28/4/2006" then %>Show Image Here <% else %> Show Default Image<%end if %>
    Someone please put me out of my mysery!
  2. #2
  3. Contributing User
    ASP High Scholar (3500 - 3999 posts)

    Join Date
    Jul 2005
    Location
    Oxford UK
    Posts
    3,897
    Rep Power
    992
    try this
    Code:
    <%
     if (date() >= #27/04/2006# and Date()<= #28/04/2006#) then %>
     Show Image Here
      <% else %>
       Show Default Image
       <%end if %>
    Nothing is Impossible bcoz IMPOSSIBLE itself says..
    I M POSSIBLE........................
    Be cool !!!!!!!!
  4. #3
  5. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    303
    Rep Power
    16
    Thanks Guddu, that's seems to work beautifully.

    I've never used hash before? What does that do? I assume it encloses a numerical value???

    (sorry, still very much a novice on asp)
  6. #4
  7. Contributing User
    ASP High Scholar (3500 - 3999 posts)

    Join Date
    Jul 2005
    Location
    Oxford UK
    Posts
    3,897
    Rep Power
    992
    hash used for date value constant ...
    glad your problem is sorted ..

    Comments on this post

    • GeekGirl agrees

Similar Threads

  1. Will not show the date
    By aero in forum ASP Development
    Replies: 1
    Last Post: January 6th, 2006, 01:57 PM
  2. Date Range Comparison
    By lezbfranz in forum ASP Development
    Replies: 7
    Last Post: February 18th, 2005, 06:11 PM
  3. BETWEEN for Text Data type Date Range
    By Kenz21 in forum Microsoft Access Help
    Replies: 3
    Last Post: January 11th, 2005, 10:18 AM
  4. Date Range
    By Aldo in forum ASP Development
    Replies: 0
    Last Post: September 30th, 2003, 07:11 AM
  5. Date Range
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: January 7th, 2002, 02:15 AM

IMN logo majestic logo threadwatch logo seochat tools logo