I am using the INSERT statement below to insert NOW into a datetime field in a SQL dbase
<%
varAlert = request.querystring("alertID")
varInspector = session("stUserid")
varDateRead = NOW
dim sqlalerts
Set con = Server.CreateObject("ADODB.Connection")
con.Open MM_inspections_STRING
sqlalerts = "INSERT INTO dbo.tbl_AlertsRead (alertID, inspectorID, dateread) VALUES ('" & varAlert & "' ,'" & varInspector & "','" & varDateRead & "')"
con.Execute sqlalerts
con.Close
Set con = Nothing
%>
but it's returning :
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][SQL Server Native Client 10.0][SQL Server]The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
/html/admin/inspectorsAlertView.asp, line 25
line 25 is the execute statement, am at a loss, NOW returns a valid datetime, and the field 'dateread' is definitely a datetime field, and the above INSERT has worked dozens of times without a problem.