[thelist] ASP Date Manipulation

Feingold Josh S Josh.S.Feingold at irs.gov
Tue Mar 19 09:13:00 CST 2002


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
I am trying to show only those records where the date is not older than 3
months from a date in the database.

Here is my code:

pastdate = DateAdd("m",-3,Now())  'pastdate is now three months ago

do while not rs.eof
    if rs("date_completed") > pastdate then  'if date in database is newer
than date three months ago
        response.write pastdate  'show the date
    end if
loop

I tried using both 2/01/02 and 2/01/02 in the database and neither makes the
date show.

Anyone know where I am wrong?

Thanks,
Josh



More information about the thelist mailing list