Sum / Sumif of a field

G

Guest

I have a table that stores peoples holiday (vacation) info. There is a start
date and end date... thus calculating a duration. However, I want to create a
query that will be the source for a report that will return the total number
of days off that people have had. eg

Name Duration
------- -----
Jim 2
Dave 5
Steve 3
Jim 1
Dave 4
Steve 3
... etc

So my query returns this :-
Jim 3
Dave 9
Steve 6

This is probably something really simple that im missing - anyone point me
in the right direction please ?? :D:D
 
G

Guest

Always the same, I search for hours and end up posting for help then find it
myself within a matter of minutes.

By using the 'Totals' button, I found out how to Sum instead of Group By.
 
G

Guest

hi,

I think the below query solves ur problem

select sum( Duration ) from tablename group by name;

Pls let me know if this helps u

Thanks

Sunil.T
 

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

Top