Are you sure that you aren't adding that twenty thousand years by accident?

It is for a dues expire, are you doing a + 1 to it?  For example:
<cfset Variables.mydate = '04/30/2014' />
<cfset Variables.mydate = Variables.mydate + 1 />

Result in this case would be Variables.mydate = '04/40/20141'.
Instead something like dateadd("m", 1, Variables.mydate) needs to be used.

Just a possibility. We can only guess without seeing the code between where the 
date comes in and when it is actually processed by the createodbcdate.

Steve

-----Original Message-----
From: Stephens, Larry V [mailto:steph...@iu.edu] 
Sent: Friday, September 06, 2013 10:31 AM
To: cf-talk
Subject: RE: CreateODBCDate()


shouldn't it be 2014 not 20141 ?

Your year is 20141 that is close to twenty thousand years in the future.


I know that - that's why I get the error on UPDATE. My question is has anyone 
ever seen CreateODBCDate create something like this?

My point below is that if FORM had passed 04/30/20141 to CreateODBCDate the 
error would have been thrown there and the query would never be attempted. It 
looks to me like FORM passed 04/30/2014 (which would be correct in this 
context) and CreateODBCDate added the 20,000 years. I don't know why it would 
do that.


On Fri, Sep 6, 2013 at 1:33 PM, Stephens, Larry V <steph...@iu.edu> wrote:

>
> I'm stumped. This is an UPDATE query running on a CF8 server with an
> Access backend. (This is before I started using cfqueryparam and I haven't
> had a chance to update this code.) I've abbreviated the page.
>
> <cfparam name="FORM.DuesExpire" default="">
>
> In the query: DuesExpire = <cfif len(FORM.DuesExpire) EQ
> 0>NULL<cfelse>#CreateODBCDate(FORM.DuesExpire)#</cfif>,
>
> This has been working.
>
> I'm using cftry. Here's the message it sent me:
>
> Detail: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC
> Microsoft Access Driver] Syntax error (missing operator) in query
> expression 'd '20141-04-30'}'
>
> It shows the query:  ..., DuesExpire = {d '20141-04-30'}, ...
>
> I tried a test, thinking that the FORM value was malformed (it's set by
> the program, not manually entered):
>
> <cfset x = '20141/04/01'>
> <cfoutput>#CreateODBCDate(x)#</cfoutput>
>
> That throws:
> 20141/04/01 is an invalid date or time string.
>
> This implies to me that an error would have been thrown by the attempt to
> create the date via CreateODBCDate, but it looks to me like the function
> created a malformed ODBC date and the program choked when it tired to
> insert that into the table.
> Am I missing something? Any suggestions what happened?
> Larry Stephens
>
>
>
>
> 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356717
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to