Look at your query closely.  it's asking for everything that's greater than 
c, AND select everything less than e.  so that means it will select a 
through z.  umm I think.  instead, use the BETWEEN thingy.

dunno =)







>From: "Will Swain" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: sorting within date range
>Date: Wed, 05 Sep 2001 15:35:36 +0100
>
>Hi,
>
>I want the user to be able to input a start and end date and then pull
>relevant records out of an Access db between those dates.
>
>The datatype in the db is Date/Time
>
>This is the query:
>
><cfquery name="getcount" datasource="#Request.App.dsn#">
>       SELECT *
>       FROM tbl_downloads
>       WHERE story = '#Form.story#'
>       <cfif startdate IS NOT "">
>       AND datedownloaded >= #CreateODBCDate(Form.startdate)#
>       </cfif>
>       <cfif enddate IS NOT "">
>       AND datedownloaded <= #CreateODBCDate(Form.enddate)#
>       </cfif>
></cfquery>
>
>However, if I enter dates, they seem to be ignored, and the query just 
>pulls
>out all instances if I have only entered a start date and none if I enter a
>start and an end date.
>
>Either way it's not working.
>
>Any suggestions?
>
>Cheers
>
>
>Will Swain
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to