CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 toSQL(Now,ccsDate) always gives error with SQL2005

Print topic Send  topic

Author Message
Slopey

Posts: 33
Posted: 03/14/2007, 1:05 PM

Anyone else come across a problem using the Connection.toSQL method for datetime fields with SQL Server 2005?

I used Connection1.toSQL(Now,ccsDate) previously with an SQL Server 2000 database without any issues, but now I've upgraded to SQL Server 2005, I always get "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. (Microsoft SQL Native Client)".

I can work around it by converting the date into a more acceptable ISO format string for SQL Server, but it's hell of an annoying.

Anyone come across it?

S.
View profile  Send private message
Benjamin Krajmalnik
Posted: 03/15/2007, 11:44 PM

I prefer to use CCToSQL.
Are you trying to use a date or datetime?
The safe way would be to use the CCFormatDate() function.
I prefer to pass the dates as array("yyyy","mm","dd") (note n separators)
since this makes it locale independent, whereas the standard with the "-"
delimiters can cause a problem if the database loclization is different than
the web server's.

"Slopey" <Slopey@forum.codecharge> wrote in message
news:645f863ac4c6da@news.codecharge.com...
> Anyone else come across a problem using the Connection.toSQL method for
> datetime
> fields with SQL Server 2005?
>
> I used Connection1.toSQL(Now,ccsDate) previously with an SQL Server 2000
> database without any issues, but now I've upgraded to SQL Server 2005, I
> always
> get "The conversion of a char data type to a datetime data type resulted
> in an
> out-of-range datetime value. (Microsoft SQL Native Client)".
>
> I can work around it by converting the date into a more acceptable ISO
> format
> string for SQL Server, but it's hell of an annoying.
>
> Anyone come across it?
>
> S.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.