Somk
Somk

Reputation: 12047

Error converting datetime from character string

INSERT INTO Restaurants_final (DateField) VALUES ('01/01/2000')

This query keeps coming back with Conversion failed when converting datetime from character string. But this method has worked seemlessly for me for years. What am I doing wrong?

DateField is set to a datetime format.

Upvotes: 0

Views: 1390

Answers (1)

Mahmoud Gamal
Mahmoud Gamal

Reputation: 79929

Insert these dates literal in a language neutral manner, using the format YYYYMMDD like this:

INSERT INTO Restaurants_final (DateField) VALUES ('20000101')

Upvotes: 0

Related Questions