[thelist] SQL, Dates and more mental health

Ryan Mayberry Ryan at applicor.com
Tue Apr 3 14:28:04 CDT 2001

Thanks to everyone who had suggestions for my event calendar and date
problem I had last week...  
--------- snip from original thread
In the database I am recording the Start Date and End Date of the event...
On the page that is supposed to display events I have a date variable
(view_date) which is either the current date or one selected by the user.. 
--------- end snip

I (kind of) solved the problem of matching the date variable with the START
and END dates in the database.. All I had to do was Cdate() the date
variable to insure that it was in fact a date.

However, this only works when I open all the records from the database and
then loop through the record set to find the matches.

I need to find the matches right in my SQL statement which I still cannot
do. The fields in the database are of the data type DATE/TIME, and I have
Cdate() 'ed my variable so it to is a date, but still I get nothing from my
SQL statement (as seen below)..

SELECT * FROM tblEvents WHERE view_date BETWEEN dteEvStart AND dteEvEnd

Any other suggestions would be mucho appreciated..

More information about the thelist mailing list