Forums

ASP

This topic is locked

Create a Recordset that looks for dates

Posted 10 Sep 2002 20:57:07
1
has voted
10 Sep 2002 20:57:07 Sean Maher posted:
SOMEBODY HELP!!! I'm trying to create a recordset that will grab all records between two dates. There is a field in the Database with dates in mm/dd/yyyy format. And for the life of me I can't figure out how to get the dates into the SQL statement without them becoming strings, and giving me a data type mismatch error. Anyone have any sample code or suggestions?

(8')~

Replies

Replied 11 Sep 2002 00:12:34
11 Sep 2002 00:12:34 johannes nel replied:
in a select statement the date variables should be inserted between #'s (hash/sharp whatever!)
example:

"Select * from t_Table Where ((date > #" & startdate & "#) and (date< #& endDate & "#))"

<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>



Reply to this topic