Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Problem with inserting data


Message #1 by "Petr Novotny" <pn@b...> on Mon, 19 Nov 2001 09:17:16
Hi,



I have a following problem:



When I try to SQL insert data into datetime field in SQLServer database I 

get a following message:



[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char 

data type to a datetime data type resulted in an out-of-range datetime 

value. 



here is the extract of the Insert statement:



SQL = "Insert into Service" &_

	  "(ServiceName, Customer, Installer, ContractSigned, 

SmartBoxNeed)"&_

	  " values

('"&ServiceType&"','"&CustomerName&"','"&Installer&"','"&ContractSigned&"',

'"&SBneeded&"')"



Can anyone help with what I'm doing wrong?



Thank you



Petr
Message #2 by "Tomm Matthis" <matthis@b...> on Mon, 19 Nov 2001 08:04:35 -0500
Try this:

 	  " values

 ('"&ServiceType&"','"&CustomerName&"','"&Installer&"','"&

CDATE(ContractSigned) &"',

 '"&SBneeded&"')"



-- Tomm



> -----Original Message-----

> From: Petr Novotny [mailto:pn@b...]

> Sent: Monday, November 19, 2001 9:17 AM

> To: ASP Databases

> Subject: [asp_databases] Problem with inserting data

>

>

> Hi,

>

> I have a following problem:

>

> When I try to SQL insert data into datetime field in SQLServer database I

> get a following message:

>

> [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char

> data type to a datetime data type resulted in an out-of-range datetime

> value.

>

> here is the extract of the Insert statement:

>

> SQL = "Insert into Service" &_

> 	  "(ServiceName, Customer, Installer, ContractSigned,

> SmartBoxNeed)"&_

> 	  " values

> ('"&ServiceType&"','"&CustomerName&"','"&Installer&"','"&ContractSigned&"',

> '"&SBneeded&"')"

>

> Can anyone help with what I'm doing wrong?

>

> Thank you

>

> Petr

>




> $subst('Email.Unsub')

>

>




  Return to Index