DECLARE sdt SMALLDATETIME
SET sdt = '20030701 23:59'
SELECT CAST(FLOOR(CAST(sdt AS FLOAT))AS SMALLDATETIME)
Note that my smalldatetime variable is different because:
1) 2003-07-01 is interpreted differently depending on the dateformat set for
your user. Only yyyymmdd and yyyy-mm-ddThh:mm:ss.nnn are interpreted
independently of the users dateformat.
2) The precision of smalldatetime is minutes, not seconds. That is why the
original conversion went wrong, it is rounded up to midnight the next day
when you store a time between 23:59:30 and 23:59:59.
"Vishal Parkar" <com> wrote in message