no '' around dates
Terry Bader
IT/Web Specialist
EDO Corp - Combat Systems
(757) 424-1004 ext 361 - Work
[EMAIL PROTECTED]
(757)581-5981 - Mobile
[EMAIL PROTECTED]
icq: 5202487 aim: lv2bounce
http://www.cs.odu.edu/~bader
> -----Original Message-----
> From: Bill Davies [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 18, 2001 12:50 PM
> To: CF-Talk
> Subject: Access 2000 SQL 'between ... and ...'
>
>
> Can any1 tell me whats wrong with this this?
>
> <CFQUERY NAME="checkWorkerTimes" DATASOURCE="#Application.DSN#">
> SELECT id
> FROM timeChunks
> WHERE (worker = #Attributes.worker#) AND ('#Attributes.startDateTime#'
> BETWEEN ##[timeChunks.start]## AND ##[timeChunks.end]##)
> </CFQUERY>
>
> Returns -
>
> ODBC Error Code = 37000 (Syntax error or access violation)
>
> [Microsoft][ODBC Microsoft Access Driver] Syntax error in
> date in query
> expression '(worker = 2) AND ( ('18/04/01 12:15:00' BETWEEN
> #[timeChunks.start]# AND #[timeChunks.end]#) )'.
>
>
> WHERE (worker = #Attributes.worker#) AND ('#Attributes.startDateTime#'
> BETWEEN ##1/1/01## AND ##1/1/01##)
> works fine
>
> Many thanks.
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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