title: SQL Server - Get the final sum of a product of two columns
body: <p>Despite my little knwoledge of SQL Server, i'm stucked on this problem for a while:</p>
  
  <p>I'm trying to get the final sum of a product of two columns, but SQL Server won't recognize my last column. Here is the query:</p>
  
  <pre><code>SELECT
  Products.customName AS 'Name',
  Ordered_Products.scanned AS 'Sent Quantity',
  Charged_Products.price AS 'Product Price',
  Ordered_Products.scanned * Charged_Products.price AS 'Charged'
  FROM Products
      JOIN Charged_Products
          ON Products.productsId = Charged_Products.productsId
      JOIN Ordered_Products
          ON Ordered_Products.productsId = Products.productsId
  WHERE
  Ordered_Products.ordersId = 500 AND
  Ordered_Products.scanned &gt; 0
  UNION ALL
  SELECT 'TOTAL', '', '', SUM('Charged')
  </code></pre>
  
  <p>It should look something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/MYwuI.png" alt=""></p>
  
  <p>Could somebody point me in the right direction to make the query work ? Any help would be much appreciated.</p>