jasonhuibers
Programmer
SQL Server 2008 Express
CreateDate Datetime datatype
When I execute the query below I get the error:
-Conversion failed when converting date and/or time from character string.
varCreateDate = date()
varCreatedBy = "jsmith"
sql_insert = "insert into Table1(CreateDate,CreatedBy) values ('" & varCreateDate & "', '" & varCreatedBy & "')"
response.write sql_insert
This is the output:
insert into Table1 (CreateDate,CreatedBy) values ('19/03/2012 5:41:20 PM', 'jsmith')
CreateDate Datetime datatype
When I execute the query below I get the error:
-Conversion failed when converting date and/or time from character string.
varCreateDate = date()
varCreatedBy = "jsmith"
sql_insert = "insert into Table1(CreateDate,CreatedBy) values ('" & varCreateDate & "', '" & varCreatedBy & "')"
response.write sql_insert
This is the output:
insert into Table1 (CreateDate,CreatedBy) values ('19/03/2012 5:41:20 PM', 'jsmith')