I assume that you are actually converting from character data to insert into a datetime column. To do this you need to convert the string into a format that SQL Server sees as unambiguous, like YYYYMMDD MM:SSselect Date = convert(datetime, substring(DS,5,4)+substring(DS,3,2)+left(DS,2)+right(DS,6))from ( select DS = '31122006 00:00' ) aResults:Date ------------------------------------------------------ 2006-12-31 00:00:00.000(1 row(s) affected)
CODO ERGO SUM