/ Published in: SQL
This is the best method for querying a table to get data where a date column needs to equal today:
- -- 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)
You need to login to post a comment.