Problems with Dates -
11-10-2005
, 12:20 PM
Hi Guys,
I've got some problems with dates that I simply can't get my head around at
all.
I'm using ASP/VBscript and MS Access and I'm trying to implement the
following:
1, Retrieve from "tbl_EmailLastSent" the date that the email was last sent
2, Retrieve from "tbl_applications" a list of all applications that have
been received after (e.g. are newer than) the date retrieved in step 1
So (step1), I've created a recordset called "rs_LastSent" and buy ordering
the recordset in descending ID number order I get the date of the most
recent email that was sent out. This happens to be 01/11/05.
This is where I start to fail now...
In creating the (step2) second recordset I specify that I want to filter the
database on the "AppDate" column where the value in the AppDate column is
greater than the date retrieved in step 1
E.g.
SELECT *
FROM tbl_applications
WHERE APPDATE > varDate
I have then specified "varDate" as being rs_LastSent.Fields.Item("DateSent")
My logic (at least to me) looks sound enough, but every single record in the
applications table is returned rather than just the ones newer than the date
of the last email that was sent out.
I've even tried setting the value of a session variable to be the date of
the last email sent and then tried filtering the database based on the
session variable but that doesn't work either.
Can anyone possibly see where I'm going wrong.
Regards
David |