[thelist] ASP and SQL and dates

darren darren at web-bitch.co.uk
Fri Aug 15 09:09:40 CDT 2003

On Friday, August 15, 2003 at 14:27, Lightening wrote:

L> This is similar to a question I asked earlier except that was an integer,
L> this is a date. You guys recommended CInt (which fixed it) back then, so I
L> tried CDate now, with no result. This code finds no records, although there
L> are records there.

L> Can som one help me with this?

try wrapping your date in #'s...

   sql="SELECT HolidayId, HolidayName,  TimeOpen, TimeClose, HDate " &_
       " from HolidayTable where hdate >= #" & cdate(firstDateOfMonth) &_
       "# and hdate <= #" & cdate(lastDateOfMonth) & "#"

should work for access...



More information about the thelist mailing list