How can I group by date time column without taking time into consideration
In pre Sql 2008 By taking out the date part:
GROUP BY CONVERT(CHAR(8),DateTimeColumn,10)
GROUP BY DATEADD(day, DATEDIFF(day, 0, MyDateTimeColumn), 0)
Or in SQL Server 2008 onwards you could simply cast to Date
as @Oded suggested:
GROUP BY CAST(orderDate AS DATE)
Cast/Convert the values to a Date
type for your group by.
GROUP BY CAST(myDateTime AS DATE)
CAST datetime field to date
select CAST(datetime_field as DATE), count(*) as count from table group by CAST(datetime_field as DATE);