How to check if a datetime field equals current date in SQL Server Transact SQL

Had to write a SQL Server query to check if a date is the current day. After some searching I found a good way of doing it here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=38012

SELECT * FROM table WHERE DATEDIFF(day, StartDate, GETDATE()) = 0

Comments

Popular posts from this blog

Show/Hide formatting text in MS Word 2010

Microsoft.ApplicationBlocks. ExceptionManagement The event source x does not exist error

ASP.NET 2.0 DropDownList EnableViewState