Print Page | Close Window

date script

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=27769
Printed Date: 29 March 2026 at 5:15pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: date script
Posted By: WebCity
Subject: date script
Date Posted: 31 August 2009 at 11:08pm
Hi here is what I have.  I have 10 events  9/3/09 and 10/12/09 and so on.  I have created images for each event.  Ok this is what I want to do, I want to say  if today's date is < or = to 9/3/09 then show image 1 if today's date is greater than 9/3/09 then show image 2 and so on.
 
 



Replies:
Posted By: WebCity
Date Posted: 05 September 2009 at 6:40pm

<%
dim date1, date2, date3, date4, date5, Cdate

Cdate = date()

date1 = #9/5/2009#
date2 = #9/12/2009#
date3 = #09/19/2009#
date4 = #09/26/2009#
date5 = #10/17/2009#

If Cdate <= date1 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date1 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date2 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date3 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date4 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

if Cdate > date5 then %><img border="0" src="your_image.png" width="169" height="51"><%end if

%>



Posted By: ZipItDotCom
Date Posted: 16 November 2009 at 10:32pm
I found this code above and tried it but it either posted every picture at once then only removed them with the next date. 
 
Here is the code I have tried to make work but the image from the date before doesn't get removed.
 
<%
Dim Cdate
 
cdate = date()
 
if Cdate < #11/20/2009# > #11/25/2009# then %><img border="0" src="event1.png" width="169" height="51"><%end if
 
if Cdate < #11/26/2009# > #12/6/2009# then %><img border="0" src="event1.png" width="169" height="51"><%end if
 
if Cdate < #12/7/2009# > #12/23/2009# then %><img border="0" src="event1.png" width="169" height="51"><%end if
%>
 
 
How can I get it to post only one image at a time?  Is there a way to put the dates in ranges then when the current date is greater than the range of dates it skips the code and goest to the next range?


Posted By: godeep
Date Posted: 31 January 2010 at 4:02pm
if Cdate >= firstDATESPECIFIED and Cdate < secondDATESPECIFIED then



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net