Hello,
this seems like it should be a simple problem, but I'm havin some problems with it. USing Access 2k with my ASP.
I'm making a search page for records in the database. One part of it is to search for records before a date, after a date, or between two dates.
The problem is that even though there are dates in the database that are between the two selected dates from the form, no results are found.
Here are two different SQL statements I've tried using...
sql = "SELECT * FROM rec WHERE (((rec.dateSubmitted) > " & CDate(YearStart & "-" & MonthStart & "-" & DayStart) & " AND ((rec.dateSubmitted) < " & CDate(YearEnd & "-" & MonthEnd & "-" & DayEnd) & ")"
sql = SELECT * FROM rec WHERE ((rec.thedate) BETWEEN " & CDate(YearStart & "-" & MonthStart & "-" & DayStart) & " AND " & CDate(YearEnd & "-" & MonthEnd & "-" & DayEnd) & ""
It doesn't come up with any errors for either one, it just doesn't return results when there should be.
Am I doing somthing wrong here that someone else can see?
-Ovatvvon :-Q
this seems like it should be a simple problem, but I'm havin some problems with it. USing Access 2k with my ASP.
I'm making a search page for records in the database. One part of it is to search for records before a date, after a date, or between two dates.
The problem is that even though there are dates in the database that are between the two selected dates from the form, no results are found.
Here are two different SQL statements I've tried using...
sql = "SELECT * FROM rec WHERE (((rec.dateSubmitted) > " & CDate(YearStart & "-" & MonthStart & "-" & DayStart) & " AND ((rec.dateSubmitted) < " & CDate(YearEnd & "-" & MonthEnd & "-" & DayEnd) & ")"
sql = SELECT * FROM rec WHERE ((rec.thedate) BETWEEN " & CDate(YearStart & "-" & MonthStart & "-" & DayStart) & " AND " & CDate(YearEnd & "-" & MonthEnd & "-" & DayEnd) & ""
It doesn't come up with any errors for either one, it just doesn't return results when there should be.
Am I doing somthing wrong here that someone else can see?
-Ovatvvon :-Q