Cast varchar to datetime
Jeg skal konvertere en tekststreng til DateTimeSELECT CAST('2014-05-28 02:03:04' AS DATETIME) AS Datofelt
virker men mit datoformat står således:
SELECT CAST('28-05-2014 02:03:04' AS DATETIME) AS Datofelt
og det giver denne fejl;
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.