I have a bunch of product orders and I\'m trying to group by the date and sum the quantity for that date. How can I group by the month/day/year without taking the time part
CAST datetime field to date
select CAST(datetime_field as DATE), count(*) as count from table group by CAST(datetime_field as DATE);
In pre Sql 2008 By taking out the date part:
GROUP BY CONVERT(CHAR(8),DateTimeColumn,10)