Filter by Dates in SQL
If your dates column does not contain time information, you could get away with: WHERE dates BETWEEN ‘20121211’ and ‘20121213’ However, given your dates column is actually datetime, you want this WHERE dates >= ‘20121211’ AND dates < ‘20121214’ — i.e. 00:00 of the next day Another option for SQL Server 2008 onwards that retains … Read more