Sum / Sumif of a field

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
Back
Top