|
 |
access_asp thread: How to use this date function?
Message #1 by "Marko Ramstedt" <marko.ramstedt@a...> on Thu, 5 Sep 2002 16:13:24
|
|
I'm trying to build a very simple action that
checks the date and if it's > than some prefixed
date, it redirects somewhere else.
I have this so far:
if Date () > "9/3/2002" then
response.redirect "http://www.website.com"
End if
But I suppose it's too simple, because it doesn't work.
Message #2 by "Daniel Watts" <danielwatts@c...> on Thu, 5 Sep 2002 16:16:50 +0100
|
|
I don't know if there is a higher-level way to do this but you could
always extract the year, month, day and do a few if tests to compare them
bit by bit.
dont' get caught by the trap thinking each component must be larger than
the one you are comparing it to!
or you could do some mathsy thing where you convert each to a number and
compare the numbers.
eg: year * 100 + month * 10 + day
Dan
-----Original Message-----
From: bounce-access_asp-1177363@p...
[mailto:bounce-access_asp-1177363@p...]On Behalf Of Marko
Ramstedt
Sent: Thursday 05 September 2002 16:13
To: Access ASP
Subject: [access_asp] How to use this date function?
I'm trying to build a very simple action that
checks the date and if it's > than some prefixed
date, it redirects somewhere else.
I have this so far:
if Date () > "9/3/2002" then
response.redirect "http://www.website.com"
End if
But I suppose it's too simple, because it doesn't work.
Message #3 by "Ken Schaefer" <ken@a...> on Fri, 6 Sep 2002 10:11:01 +1000
|
|
<%
dteFixedDate = "2002/03/09"
If Date() > CDate(dteFixedDate) then
Response.Redirect(...)
End If
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Marko Ramstedt" <marko.ramstedt@a...>
Subject: [access_asp] How to use this date function?
: I'm trying to build a very simple action that
: checks the date and if it's > than some prefixed
: date, it redirects somewhere else.
:
: I have this so far:
:
:
: if Date () > "9/3/2002" then
:
: response.redirect "http://www.website.com"
:
: End if
:
: But I suppose it's too simple, because it doesn't work.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #4 by "Charles Mabbott" <aa8vs@m...> on Thu, 05 Sep 2002 20:51:25 -0400
|
|
I have played with dates a bit and this may help out.
There is a record item that contains date of renewal
in the form 4/01/2003, 4/01/2002 [expired]
Here is code segment:
objcommand.commandtype = adcmdtext
set objrs = objcommand.execute
set objcommand = nothing
' response.write "Date " & objRS("renew") - date() & "<br>"
<center>
<caption><h2>Interstate 94<br>
Name, Call, and Renewal date<br> Member Status</h1>
</caption>
response.write "<table border=2 >"
While Not objRS.EOF
sdate = objRS("Renew")
' check for past due members against current date
if (sdate - date() < 0) then
sdate = "PAST DUE"
end if
' check for life members
>From: "Marko Ramstedt" <marko.ramstedt@a...>
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] How to use this date function?
>Date: Thu, 5 Sep 2002 16:13:24
>
>I'm trying to build a very simple action that
>checks the date and if it's > than some prefixed
>date, it redirects somewhere else.
>
>I have this so far:
>
>
>if Date () > "9/3/2002" then
>
> response.redirect "http://www.website.com"
>
>End if
>
>But I suppose it's too simple, because it doesn't work.
"If your not part of the solution,
there is good money to be made
prolonging the problem."
http://68.43.100.7:81/aa8vs
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
|
|
 |