Convert a string into datetime
Posted on 2006-05-11
I'm getting an error
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting datetime from character string.
I'm thinking that error comes from this date which is a string, and which gets inserted into table1 as string, while the data type of the column is datetime...
So the solution would be to convert this data into datetime before I insert it into the table...can you help me?
aspPostingDate=Request.Form("txtPostMonth") & "/" & Request("txtPostDay") & "/" & request("txtPostYear")
sql="INSERT INTO Table1 (postingDate)"
sql=sql & " VALUES "& aspPostingDate & ")"