troubleshooting Question

SQL - Omit Records That Sum to 0

Avatar of Tim Stutzman
Tim Stutzman asked on
SQLMicrosoft SQL Server
2 Comments2 Solutions17 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros