title: Query to update records using sum of fields and conditional
body: <p>I am trying to look at all of the records in a table and if the sum of some columns (HandleTime, HoldTime, NotReadyTime) is greater than another column (LoggedTime) then set that column to the sum. </p>
  
  <p>Basically this, extended for the whole table, but as an SQL query in the database:</p>
  
  <pre><code>If Sum(HandleTime,HoldTime,NotReadyTime) &gt; LoggedTime then
      LoggedTime = Sum(HandleTime,HoldTime,NotReadyTime)
  End if
  </code></pre>
  
  <p>Not sure whether to use a SELECT or UPDATE query, or how to utilise the sum. I think it might be DSUM? I tried both but returned empty fields.</p>
  
  <p>Thanks in advance!</p>