Click to See Complete Forum and Search --> : Date


Mac
02-10-2003, 11:26 AM
Hi All

Ive got a login page , and what i want to happen is when the user logs in it checks an expiry date which is stored in a Access DB , and if the account has expired it prompts the user and then redirects the user to another page.

This is the code that i tried but it didnt seem to work:

<CODE>
if rsDate.fields("ExpiryDate").value = Now() then
response.write "Sorry your account has expired"
response.redirect "expired.htm"
end if
</CODE>

Thanks

netvizion
02-10-2003, 11:54 AM
You probably want it to say less than instead of equal because it's not going to be the exact time down to the last second.

Mac
02-10-2003, 12:29 PM
So my code should look something like this:

<CODE>
if rsDate.fields("ExpiryDate").value < Now() then
response.write "Sorry your account has expired"
response.redirect "expired.htm"
end if

</CODE>