PDA

View Full Version : compare server date with access database date


jsawkang
06-23-2003, 01:57 AM
Hi...

i have a code that seem not working. here is the code
ddate=date()
<%if (rs("ndate")>ddate) Then%>
Date of Promotion: <b><%=rs("ndate")%></b>
<%end if%>

i'm comparing the access database date stored in "ndate" with server date. if the date in database greater than server date, it then display the promotion date.

help please.

thanks.

Jong Saw Kang

Bullschmidt
06-23-2003, 11:54 PM
Instead of this:
if rs("ndate")>ddate then

How about something like this:
if datediff("D", ddate, rs("ndate")) > 0 then

Or this:
if CDate(rs("ndate"))>ddate then