Filtering, sorting, summing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kbaisch
    New Member
    • Mar 2007
    • 19

    #1

    Filtering, sorting, summing

    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
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by kbaisch
    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

    Comment

    • ganeshkumar08
      New Member
      • Jan 2008
      • 31

      #3
      Originally posted by kbaisch
      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_#)

      Comment

      Working...