title: Adding certain minutes to time in MySQL
body: <p>This question is related to <a href="https://stackoverflow.com/questions/1421409/mysql-dateadd-does-not-work">this question</a></p>
  
  <p>I have a field which is a time-field (it does not need to be a datetime field, cause the date part makes no sense here). The value i want to add is in another field, in minutes.</p>
  
  <p>So basicly, I want to add minutes to a time value. I have tried the DATE_ADD function, but it expects the date to be a datetime, with the datepart set. I also tried the ADDTIME function, but the problem here is that the duration field is in whole minutes, and not in the format hh:mm:ss, so it just adds it as seconds.</p>
  
  <p>Does anyone know a way to accomplish this?</p>
  
  <p>[edit]</p>
  
  <p>This is the current query:</p>
  
  <pre><code>SELECT ADDTIME(startTime, duration * 60), startTime, duration FROM tblAppointment
  JOIN tblThreatment ON tblThreatment.threatmentid = tblAppointment.threatment_id;
  </code></pre>
  
  <p>and this is the result:</p>
  
  <pre><code>+-----------------------------------+-----------+----------+
  | ADDTIME(startTime, duration * 60) | startTime | duration |
  +-----------------------------------+-----------+----------+
  | 09:18:00                          | 09:00:00  |       30 |
  | 10:09:00                          | 10:00:00  |       15 |
  | 09:09:00                          | 09:00:00  |       15 |
  | 10:57:00                          | 10:30:00  |       45 |
  +-----------------------------------+-----------+----------+
  </code></pre>