[thelist] Dates, ASP and mental health

Tab Alleman talleman at autobex.com
Mon Apr 2 09:47:01 CDT 2001

Using BETWEEN in your sql works, as one person suggested.  Another in-script
solution would be to convert your dates to long integers in this format
YYYYMMDDHHMMSS.  Then the <=> comparisons will work the way you want.

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Ryan Mayberry
Sent: Friday, March 30, 2001 5:41 PM
To: 'thelist at lists.evolt.org'
Subject: [thelist] Dates, ASP and mental health

I am working on an events calendar, built in ASP running off a SQL 7
Database Server..

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..

I am grabbing all the events from the database and looping through them and
displaying the ones which match the following if statement..
IF objRS("dteEvStart") <= view_date and objRS("dteEvEnd") >= view_date THEN

do this

This seems to only half work.. it works fine one some dates, but others it
hates and it seems to ignore the year completely. Example: An event which
should only show up between April 12 and April 15, 2001  will also show up
between April 12 and April 14, 2003

I have also tried grabbing the proper events right in my SELECT statement,
which is what I would prefer to do, but that seemed to return no results.

I am thinking I should record a date range in the database instead of a
start date and an end date, but I don't really want to go back and make that
change (and I don't really know how anyway).

If anyone has some suggestions I sure would like to hear about it..

(my brain hurts.. )

For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list