Jeremy Stein - Brain
« IE7 input tag rendering bug | Allow csshover.htc to act on dynamic elements: rerun parseStylesheets » |
SQL Server – truncate time from Date
In T-SQL, the easiest way to truncate a DateTime field (to get the date with midnight as its time) is this:
CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME)
But I’ve also seen it done this way:
CONVERT(VARCHAR(10), GETDATE(), 111) — just treat this as a datetime
No Comments
Be the first to comment!
« IE7 input tag rendering bug | Allow csshover.htc to act on dynamic elements: rerun parseStylesheets » |
Leave a Reply