title: SQL operand data type datetime / varchar is invalid for sum operator
body: <p>I am trying to subtract one column from another column, and then sum the result. However, whatever I change I keep getting one of the two errors as mentioned in the title. </p>
  
  <p>From all other questions posted, I derived that my statement should be something like:</p>
  
  <pre><code>SELECT SUM(EndTime-BeginTime) AS TotalTime FROM TimeRegister 
  WHERE OrderNumber = 00000 AND Activity = 11111;
  </code></pre>
  
  <p>As per suggestion in another topic, I changed the statement to:</p>
  
  <pre><code>SELECT SUM(CONVERT(varchar(EndTime-BeginTime), 108)) AS TotalTime FROM TimeRegister 
  WHERE OrderNumber = 00000 AND Activity = 11111;
  </code></pre>
  
  <p>However, I still receive the error.
  The times are stored as follows:</p>
  
  <pre><code>1-1-1900 7:30:00
  </code></pre>
  
  <p>Thanks for any suggestion...</p>
  
  <hr>
  
  <p><strong>Edit 1:</strong> Oh, I am using a Microsoft Query through ODBC for SQL in Excel, kind of like:
  <a href="https://stackoverflow.com/questions/20977348/excel-vlookup-incorporating-sql-table">Excel vlookup incorporating SQL table</a> </p>
  
  <hr>
  
  <p><strong>Edit 2:</strong> I prefer to have the output again in the HH:MM format. </p>
  
  <p>The thing is, when I copy the complete database to excel, everything works just fine. I can subtract the columns and sum up. I just dont want to that manually every day....</p>
  
  <hr>
  
  <p>I just checked the SQL database, and the column is of Date/Time type.</p>