Grouping values for each day

  • Thread starter Thread starter Ste M
  • Start date Start date
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 !
 
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;
 
Thanks.
But i need to separate values from "27/08/2005" and the one from
"27/09/2005" !!
Thanks again !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top