By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,628 Members | 1,880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,628 IT Pros & Developers. It's quick & easy.

Filtering, sorting, summing

P: 19
Can someone help me with the syntax? I want to sum the hrs for each dept, name & ppe. Any help given will be much appreciated.
Thanks in advance.


Dept_# Name PPE Hrs
533 Empl Name 4/15/2006 0
533 Empl Name 4/15/2006 8
533 Empl Name 4/15/2006 8
533 Empl Name 4/15/2006 8
522 Empl Name 4/15/2006 8
522 Empl Name 4/15/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
Feb 6 '08 #1
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
Can someone help me with the syntax? I want to sum the hrs for each dept, name & ppe. Any help given will be much appreciated.
Thanks in advance.


Dept_# Name PPE Hrs
533 Empl Name 4/15/2006 0
533 Empl Name 4/15/2006 8
533 Empl Name 4/15/2006 8
533 Empl Name 4/15/2006 8
522 Empl Name 4/15/2006 8
522 Empl Name 4/15/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8

i believe GROUP BY is what you need...

-- ck
Feb 7 '08 #2

ganeshkumar08
P: 31
Can someone help me with the syntax? I want to sum the hrs for each dept, name & ppe. Any help given will be much appreciated.
Thanks in advance.


Dept_# Name PPE Hrs
533 Empl Name 4/15/2006 0
533 Empl Name 4/15/2006 8
533 Empl Name 4/15/2006 8
533 Empl Name 4/15/2006 8
522 Empl Name 4/15/2006 8
522 Empl Name 4/15/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8
540 Empl Name 4/30/2006 8

Select Dept_#, Name, PPE, Sum(Hrs) from Table_Name Group By(Dept_#)
Feb 7 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.