Thanks for the answers... it turned out to be the field AFTER the date 
which had been a date but then was changed to a varchar. I hadn't 
changed the table design on the server... D'oh!

Joe Bastian wrote:
> Easy way.. if insert just use SQL Server GetDate() time stamp.
> 
> To your question.. CreateODBCDateTime doesnt always work well..
> read it in some docs..
> Do some like this if you still want to use it.
> <cfset CFdateTime=CreateDateTime(2002,05,05,10,15,15)> (y,m,d,h,m,s)
> <cfset ODBCDT=CreateODBCDateTime(DateTime)>
> 
> Joe
> Certified Advanced ColdFusion Developer
> [EMAIL PROTECTED] 
> 
> -----Original Message-----
> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 4:25 PM
> To: CF-Talk
> Subject: Re: SQL Server Date Error
> 
> 
> 
>>Al Everett wrote:
>>
>>>>I'm getting this when writing a date to a datetime len 8 in SQL Server
>>>
>>>
>>>>2000 in a hosted environment:
>>>>
>>>>[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error
>>>>converting datetime from character string.
>>>>
>>>>It returns the error on any valid dates in mm/dd/yy format. I have
>>>>several date fields in other places but they're OK. I've
>>>>tried with and without quotes.
>>>
>>>
>>>This may be a silly question, but did you put your string inside a
>>>CreateODBCDate() function?
>>
> 
>>I tried CreateODBCDateTime(). I'll try CreateODBCDate()(what the hell).
>>  I have CF code to validate the date. And it works on our development
>>server.
> 
> 
> FYI, No quotes around the CreateODBCWhatever() functions ...
> You might also try using <cfqeuryparam> ...
> 
> Isaac Dealey
> www.turnkey.to
> 954-776-0046
> 
> 
______________________________________________________________________
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to