title: How to zero out all negative numbers in a group-by T-SQL statement
body: <p>I have a T-SQL query where I want all negative quantities to be zeroed out. </p>
  
  <pre><code>SELECT 
  p.productnumber, 
  v.[Description],
  SUM(i.Quantity) as quantity
  FROM ...
  LEFT JOIN ...
  LEFT JOIN ...
  LEFT JOIN ...
  GROUP BY productnumber, [Description]
  </code></pre>
  
  <p>Basically if the sum is made up of 5, 5, -1, the result should be 5+5+0=10, and not (5+5+(-1)=9.</p>
  
  <p>How would I do that?</p>