title: Msg 402, Level 16, State 1, Line 4 The data types varchar and varchar are incompatible in the subtract operator
body: <p>I was writing the following code </p>
  
  <pre><code>SELECT
      customer_Id,
      DOB,
      DATEDIFF(MONTH, CONVERT(date, Customer.DOB, 103), GETDATE()) AS [Age IN Months],
      Gender,
      city_code,
      Qty,
      (total_amt - (Rate + Tax)) AS [Total_sale_amt]
  FROM 
      Customer
  JOIN 
      Transactions ON Customer.customer_Id = Transactions.cust_id
  ORDER BY 
      [Age IN Months] DESC;
  </code></pre>
  
  <p>Ended up with following error msg</p>
  
  <blockquote>
    <p>Msg 402, Level 16, State 1, Line 4<br>
    The data types varchar and varchar are incompatible in the subtract operator.</p>
  </blockquote>
  
  <p>Please let me know as in this section `</p>
  
  <pre><code>( total_amt - ( Rate + Tax ) ) AS [ Total_sale_amt ]
  </code></pre>
  
  <p>I intend to to get a sales figure column additional to all other columns.</p>
  
  <p>Below is what my table looks like </p>
  
  <p><a href="https://i.stack.imgur.com/hzjeI.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>Thank you!</p>