title: How to remove rows that are all zeros from SQL query
body: <p>Should be simple to do this but cannot make it work.  Have also looked at other similar answers.  This code generates a report.  There are 3 primary categories: General Adjustments, Finance Charges, and Bad Debts.  What I am trying to accomplish...</p>
  
  <p>If these 3 columns are all zeros in a row, delete that row.  That's it.</p>
  
  <pre><code>DECLARE @startdate DATETIME
  DECLARE @lastdate DATETIME
  
  SET @startdate = '20170701'
  SET @lastdate = '20170731'
  
  CREATE TABLE #a 
  (
      ClientName VARCHAR(50), 
      JobName VARCHAR(50), 
      JobPartner VARCHAR(40), 
      [Date] DATETIME, 
      GenAdj MONEY, 
      FC MONEY, 
      BadDebt MONEY, 
      nomid INT
  )
  
  SELECT 
      C.searchname AS 'CLIENT NAME',
      n.date AS 'DATE',
      SUM(CASE WHEN NOMTYPEID=3 AND NOMSUBTYPEID=2 THEN TOTAL else 0 END) AS 'GENERAL ADJUSTMENTS',
      SUM(CASE WHEN NOMTYPEID=3 AND NOMSUBTYPEID=1 THEN TOTAL else 0 END) AS 'FINANCE CHARGES',
      SUM(CASE WHEN NOMTYPEID=3 AND NOMSUBTYPEID=0 THEN TOTAL else 0 END) AS 'BAD DEBTS',
      sl.serviceline AS 'DEPARTMENT',
      p.name AS 'PARTNER NAME'
  FROM 
      tblNominal N
  JOIN 
      tblNominalAccs A ON N.ContNominalID = A.NominalID
  JOIN
      tblclient C on N.clientid = C.clientid
  LEFT JOIN 
      tbljob j ON n.jobid = j.JobID
  LEFT JOIN 
      tblpartner p ON j.PartnerID = p.PartnerID
  LEFT JOIN 
      tbljobtype jt ON j.jobtypeid = jt.jobtypeid 
  LEFT JOIN 
      tblserviceline sl ON j.servicelineid = sl.servicelineid
  WHERE 
      Date &gt;= @startdate AND DATE &lt;= @LASTDATE
  GROUP BY 
      C.searchname, n.date, sl.serviceline, p.name
  ORDER BY 
      'CLIENT NAME' asc, 'FINANCE CHARGES' asc
  
  DROP TABLE #a
  </code></pre>
  
  <p>I think I may be overthinking this. How can I delete the rows with all zeros?  </p>
  
  <p>Thank you for reading.</p>