When you define a DECIMAL in SQL you may assume that it is some sort of float because you can put real numbers in it. The truth is that DECIMAL is a numeric data type that have fixed precision and scale, and while a definition like DECIMAL(18,6) offers a 6 decimal digit precision, it defaults to DECIMAL(18,0). Therefore when you define a variable as DECIMAL, it is some sort of long.
When you compare a DATETIME with a string representation of a date you may get into trouble when you use the separated form, because it is dependent of SET DATEFORMAT and SET LANGUAGE. To get rid of the problem, you can use unseparated format like yyyymmdd hh:mm:ss.sss, or ISO 8601 like yyyy-mm-ddThh:mm:ss.sss.