Assuming that your dates within the Access date/time fields do not contain
a time component (or, equivalently, the time was stored as 'midnight'
00:00:00) I think the following should work.

SELECT *
FROM Events
WHERE #Int(Now())# BETWEEN Start_Date_Time AND End_Date_Time

Jim


-----Original Message-----
From: Eron Cohen <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Sunday, April 23, 2000 6:59 PM
Subject: Working with durations in SQL and CF


>Hi Everyone,
>
>I am writing a Calendar/scheduling application in Cold Fusion.  My
problem
>is that I can't figure out what to put in the SQL WHERE statement to
handle
>a particular case:
>
>Someone may have scheduled a event to last several days, or even weeks.
For
>instance the event could start on April 15 and last until April 20th.
The
>IDEA is that the scheduler only allows the user to VIEW one day at a
time.
>The user selects a date and then I query the database to see what events
>take place on that day (even if they started a few days earlier and/or
won't
>end for a few days.)  I have no trouble selecting the event if it starts
or
>ends on the particular day in question, but I don't know how to handle
>events that last a few days (esp. when the user is trying to view a day
that
>is in the middle of several day event.)
>
>My table (in an MS Access 2000 database) has these fields:
>Start_Date_Time,
>End_Date_Time,
>Name_Of_event
>
>Can anyone give me any ideas on how to SELECT these events that last
several
>days when I am trying to view a day that's in the middle of the event?
>
>Thank You,
>
>Eron


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to