SQL Server 2008 is not doing what I expected with DateTime. It doesn\'t let me set DateTime variables, no matter what date format I use.
Wh
First of all - use single quotes around your date literals!
Second of all, I would strongly recommend always using the ISO-8601 date format - this works regardless of what your locale, regional or language settings are on your SQL Server.
The ISO-8601 format is either:
YYYYMMDD for dates only (e.g. 20110825 for the 25th of August, 2011)YYYY-MM-DDTHH:MM:SS for dates and time (e.g. 2011-08-25T14:15:00 for 25th of AUgust, 14:15/2:15pm in the afternoon)