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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
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