Pages

Tuesday 19 February 2013

Comparing dates without times in SQL Server

WHERE expire_date >= CAST(FLOOR(CAST( getdate() AS float)) AS datetime)

SELECT CAST(FLOOR(CAST( getdate() AS float)) AS datetime)
returns “2007-01-20 00:00:00.000″ – the date without the time.

No comments:

Post a Comment