When I run this basic script on my dev machine (Win 7 64, SQL 2008) it works perfectly:DECLARE @d1 datetimeDECLARE @d2 datetimeSELECT @d1 = CAST('2010-06-10 23:00:00' as DATETIME), @d2 = CAST('2010-09-20 23:00:00' as DATETIME)SELECT @d1, @d2However, when the exact same code is run on a live server (Win 2003, SQL 2005) it fails with the following error:The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The results show NULL for the second date, but the first date appears okay. Can anyone offer any suggestions as to why the second date is failing to convert?