12Feb/100
Remove the time part of a TSQL datetime
select cast(floor(cast(getdate() as float)) as datetime)
Basically, we cast the datetime to a float, floor it and convert it back to a datetime. The first step produces a float representation of the datetime in which the date is to the left of decimal place and the time to the right,?floor reduces it the lowest whole number and the last cast makes a datetime again.
Leave a comment