Grouping values for each day

S

Ste M

Hi all,
i have a table where i defined a DataTime field and other integral fileds.
Now i need to have the sum of the integral fileds grouped day by day, i
don't care the time values.

Example:
select operation, date_time, sum(quantity) as qty
from table1
group by ,date_time, operation;

In this example i have a different value for each different second in
date_time but i need the sum() for every entire day.

How can i do it ?
Thanks a lot !
 
P

Pete

You can use the DatePart function to extract the day, e.g.

SELECT operation, DatePart("d",date_time) as Day, sum(quantity) as qty
from table1
group by DatePart("d",date_time), operation;
 
S

Ste M

Thanks.
But i need to separate values from "27/08/2005" and the one from
"27/09/2005" !!
Thanks again !
 
Top