Avatar of Tim Stutzman
Tim Stutzman

asked on 

SQL - Omit Records That Sum to 0

I need to write a select statement that omits invoice records that sum to 0.  

Here is an example.  In my select statement I do not want to select invoices 31, 33 and 41 because their total value is 0 (the reversal of the invoice cancels the invoice essentially).  I would only want to select invoice 45 of $1823.43. I'm stuck on how to do this.  Any help would be appreciated.
 
CustomerCodeDocNumberTotalAmount
C4004036FTC1000031-46.95
C4004036FTC100003146.95
C4002776FTC1000033-15.78
C4002776FTC100003315.78
C4000141FTC1000041-84.35
C4000141FTC100004184.35
C4000338FTC10000451823.43

Thanks,
Tim
SQLMicrosoft SQL Server

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon