If the date is already in "dataFormat" you do not need to
"createODBCdate".Try prefacing the date variables with 'form.'.
Also, put 'inverted commas' around form.startdate and form.enddate ie;
'#form.startdate#'.
Trent shepherd
SeaSpray
-----Original Message-----
From: Will Swain [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 6 September 2001 12:36 AM
To: CF-Talk
Subject: sorting within date range
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