Try using the BETWEEN keyword.
IE
WHERE StartDate BETWEEN #CreateODBCDATE(Now())# AND (A date in the future
you set)
This will pull all the record between today and the date you specify.
----- Original Message -----
From: "Thomas Chiverton" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, February 26, 2001 9:44 AM
Subject: Selecting a date range, access DB
> My aim is to pick all records out of an access DB, by date range.
> I'm using the following CF:
> <cfquery name="bulletins"
> datasource="News">
> SELECT * FROM Articles
> where approved
> and startdate > #Now()# and
> expirydate < #Now()#
> </cfquery>
> Turning on debug on the server shows this ends up as
> SQL = SELECT * FROM Articles where approved and startdate > {ts
'2001-02-26
> 15:37:22'} and expirydate < {ts '2001-02-26 15:37:22'}
>
> Unsuprisingly, this returns no results (there is at least one record in
the
> intended range). Is my SQL off, or do I need to use a particular type of
> date in access ?
>
> Regards,
>
> Thomas Chiverton,
> Intranet Webmaster and Desktop Analyst
> Office: 01565 757 909
> As a GUI, reality in useless...
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists