You should be aware of the rules for how DATETIME is rounded up or down when you convert to SMALLDATETIME. If seconds is less than 30, it is rounded down to the nearest minute, otherwise it is rounded up.select DT, SDT = convert(smalldatetime, DT )from ( select DT = convert(datetime,'2009-10-23 10:05:29.997') union all select DT = convert(datetime,'2009-10-23 10:05:30.000') ) a
Results:DT SDT----------------------- -------------------2009-10-23 10:05:29.997 2009-10-23 10:05:002009-10-23 10:05:30.000 2009-10-23 10:06:00(2 row(s) affected)
CODO ERGO SUM