Possible Duplicate:
Best approach to remove time part of datetime in SQL Server
Suppose a table column MyDate is datetime. then following data can be saved to db:
2011-11-24 12:43:27.723
2011-11-24 12
I want to convert 2011-11-24 12:43:27.723
to 2011-11-24
with no time, I tried following way:
CONVERT(DATETIME, CONVERT(INT, MyDate))
Interesting is: 2011-11-24 12:43:27.723
is converted to 2011-11-25
instead of 2011-11-24
.
How to resolve it?