Instead of building a string for your date and
applying CreateODBCDate() to it, try building a CF
Date object using CreateDate() and applying
CreateODBCDate() to it.

If I recall correctly, CreateODBCDate() works on a
date object, not a string.
--- [EMAIL PROTECTED] wrote:
> Hi
> 
> I am getting the following Oracle error message when
> trying to run the query below, any ideas on the
> possible cause would be most appreciated
> 
> ----------
> <cfset MonthsToDisplay = 2>
> <cfset BeginDate = "#Month(now())#/1/#Year(now())#">
> <cfset EndDate = "#Month(DateAdd("m",
> MonthsToDisplay,now()))#/#DaysInMonth(DateAdd("m",
> MonthsToDisplay,now()))#/#Year(DateAdd("m",
> MonthsToDisplay, now()))#">
> 
> <cfquery name="getupcomingevents"
> datasource="events"> 
> SELECT eventid, eventdate, to_char(eventdate,'YYYY')
> AS eventYear, to_char(eventdate,'MM') AS eventMonth,
> longtitle, location 
> FROM whatson 
> WHERE eventdate BETWEEN
> trunc(#CreateODBCDate(BeginDate)#) AND
> trunc(#CreateODBCDate(EndDate)#) 
> ORDER BY eventdate asc 
> </cfquery> 
> -----------------
> 
>
--------------------------------------------------------------------------------
> 
> Error Occurred While Processing Request
> Error Diagnostic Information
> Oracle Error Code = 911
> 
> ORA-00911: invalid character 
> 
> 
> The error occurred while processing an element with
> a general identifier of (CFQUERY), occupying
> document position (12:1) to (12:54).


=====
I-Lin Kuo
Macromedia CF5 Advanced Developer
Sun Certified Java 2 Programmer


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to