Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error conversion charactar to datetime data type

Status
Not open for further replies.

Jonid

Programmer
May 4, 2001
24
AE
i get an error everytime i insert date data in my vb component and sql server bakend. an example is shown below


Sql = "insert into trans"
Sql = Sql & " values("

...
Sql = Sql & "'" & date() & "'" & ")"
...
cn.execute sql

error message: error conversion char... to datatime data type.

where my date field is datatime data type.

 
i get same error using now and even getting date from other recordset.
error converting datetime data from char or text data
 
hi
SQL Server will provide its own date and time...

insert into trans values(sysdate)
--check the syntax to be sure...it should be some variation of that...

which takes the system date and places it into the DB

bastien
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top