Try with
INSERT INTO Tutorials ([Tutorial], [StartDate])
VALUES ('3d', CONVERT(DATETIME, '07-23-08', 10));
If you set the style value to 10 the input format must be mm-dd-yy
, if you add 100 to the style value the expected format has a four digit year (110
--> mm-dd-yyyy
).
For an exhaustive table of the style values look at CAST and CONVERT (SQL Server Compact).
By the way, you could take advantage of an implicit conversion using a date format like yyyymmdd
or yyyy-mm-dd
:
INSERT INTO Tutorials ([Tutorial], [StartDate])
VALUES ('3d', '20080723');