Friday, February 17, 2006

Get just the date from a SQL Server datetime column

This should be faster than the other way ( converting it to a varchar and lopping off the time part).

SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))

Courtesy of [Greg's Cool [Insert Clever Name] of the Day]

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.