/ Published in: SQL
This is the best method for querying a table to get data where a date column needs to equal today:
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
-- 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)