Stripping time out of datetime in SQL Server 2005
(SQL Server) Keywords: no keywords
SELECT CAST(CAST(getdate() as int) as datetime)
Avoids messing about with strings :)
And then, to get the start of the current month...
SELECT CAST(CAST(DATEADD(DAY,DATEPART(DAY,getdate())*-1, getdate()) as int) as datetime);
This I am using for daily Month-To-Date reporting. Comparison is much faster this way than checking DatePart(Month,getdate()) and DatePart(Year,getdate()) against the column.