Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Countdown timer

Status
Not open for further replies.

benrob82

Programmer
Jul 28, 2005
116
GB
Hi,

I'm creating a countdown timer to a dynamic date, it reads a date from a db and then counts down to that date. I need to know once the date has been reached how i then display a message stating that the users member ship is up.............any ideas?

Also is the field I want to dynamically enter is called membership_start_date but adding it in the normal manner i.e.

<%
dim strDate
strDate = Date()

Response.Write DateDiff("d", strDate, <%=membership_start_date%>) & " days until your membership expires "
%>


is producing an error. Any help would be great.
Thanks
 
what error are you getting...

try some hardcoded value and see if it working...i mean something like...

Response.Write DateDiff("d", strDate, "09/10/2005") & " days until your membership expires "

-DNG
 
no that works fine, adding a real value produces the correct response, it may be more to do with the value not being passed across correctly
 
yes i guessed that...make sure you have the value for membership_start_date

try this:

Code:
<%
dim strDate
strDate = Date()

response.write membership_start_date

Response.Write DateDiff("d", strDate, <%=membership_start_date%>) & " days until your membership expires "
%>

-DNG
 
You've got an extra set of script delimmitters on that...
Code:
<%
dim strDate
strDate = Date()

Response.Write DateDiff("d", strDate, [highlight]<%=[/highlight]membership_start_date[highlight]%>[/highlight]) & " days until your membership expires "
%>

Wouldnt you rather have:
Code:
<%
dim strDate
strDate = Date()

Response.Write DateDiff("d", strDate, [highlight]membership_start_date[/highlight]) & " days until your membership expires "
%>



And you could skip a step like this:
Code:
Response.Write DateDiff("d", [highlight]Date[/highlight], membership_start_date)  _
               & " days until your membership expires "
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top