Results 1 to 2 of 2

Thread: How to use SUM() and Group By?

  1. #1

    Thread Starter
    Banned
    Join Date
    Jul 2018
    Posts
    4

    How to use SUM() and Group By?

    Hello experts.
    Because my english is poor, I help my self with the picture.

    Name: pp2.png
    Views: 205
    Size: 10.4 KB

    I need to calculate the unpaid sum.
    The unpaid or sum(reste) is 10 + 25.

    What I did is:
    Code:
    Select Sum(Reste) As TotalSum from Rec_tbl group BY Cs_ID
    Debug.Print TotalSum
    The output is: 70 instead of 35
    Thank you

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: How to use SUM() and Group By?

    Try this and see what you get
    Code:
    Select Cs_ID,Sum(Reste) As TotalSum from Rec_tbl group BY Cs_ID

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width