Why do we are casting to either varchar or datetime in those solutions???? I always will prefer not to use any cast/convert for column. Instead if any cast or converts required, do it for the variables. Below solutions should do......
Select * from OrderDetails
where Orderdate >= '20110101'
and Orderdate < '20110201' -- EndDate + 1
Select * from OrderDetails
where OrderDate between
'2011-01-01 00:00:00.000' and '2011-01-31 23:59:59.900'
commented on Jun 11 2011 3:53PM