Return to Snippet

Revision: 66022
at February 28, 2014 03:56 by kidmizere


Initial Code
-- edit tbl.datecolumn to reflect required column

WHERE tbl.datecolumn >= DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0) AND tbl.datecolumn < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 1)

Initial URL


Initial Description
This is the best method for querying a table to get data where a date column needs to equal today:

Initial Title
MSSQL where date=today

Initial Tags


Initial Language
SQL