> Thanks for the suggestion. It didn't work though. I have a form with a
> dropdown menu. Can dates in an Access table between: 01/01/00 and 01/01/01
> be searched ?
> -------------------------------------
> Using my code:
> <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>
> -----------------------------------
> I can the following error:
>
> ODBC Error Code = 22012 (Division by zero)
> [Microsoft][ODBC Microsoft Access Driver]Division by zero (null)
> SQL = "SELECT * FROM wwebsales where orderdate between 01/01/00 and
> 01/01/01"
> Data Source = "wwebsales"
> ----------------------------------

If you're using Access, and not using ODBC dates (esp if you're not using
ODBC) then you have to specify the start and end of the date entry

Access uses # for this, so your code would be

<CFQUERY name="getwweb" datasource="wwebsales">
        SELECT * FROM wwebsales
        where orderdate between ###startdate### and ###enddate###
</cfquery>

And I keep saying this - will people PLEASE read Ben's article "To # or not
to #"

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to