take out the single quotes from the query.

-----Original Message-----
From: Robert Orlini [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 3:30 PM
To: CF-Talk
Subject: date range search


I'm working on a search form which can search between a range of dates. I'm
using the code below and searching a orderdate column with the dates
converted to 00/00/00 format and specified as Date/Time in Access.

When I run the search (which uses a drop-down menu) I get a "data type
mismatch in criteria expression" error.

I beleive it may be with the dateformat function. Any suggestions please?

Thanks in advance. :)

-----------------------------------------------

<CFSET startdate = "#Createdate(Year,Month,Day)#">
<CFSET enddate = "#Createdate(Year2,Month2,Day2)#">
<cfset startdate = #dateformat(startdate,'mm/dd/yy')#>
<cfset enddate = #dateformat(enddate,'mm/dd/yy')#>

<CFQUERY name="getwweb" datasource="wwebsales">
SELECT * FROM wwebsales
where orderdate between '#startdate#' and '#enddate#'
</cfquery>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to