title: Trying to use DATEADD and getting function does not exist error
body: <p>I have the table <code>TableName</code> which contains approximately 5,000 rows.  It consists of a <code>product_id</code> and a <code>ScheduleTime</code>.</p>
  
  <p>What I want to do with this table is replace each value of <code>ScheduleTime</code>, regardless of whatever it might currently be.  Each record's new value of <code>ScheduleTime</code> should be set to the nominee value of <code>20</code> minutes after the previous record's, with the following exception.  If a nominee <code>ScheduleTime</code> occurs after <code>22:30:00</code> or before <code>05:00:00</code> (i.e. it is too late or too early), then it should be set to the next available datetime.</p>
  
  <p>I should be able to specify what the first new value of <code>ScheduleTime</code> will be.</p>
  
  <p>This is the query that I am using at the moment...</p>
  
  <pre><code>UPDATE TableName 
  SET ScheduleTime = DATEADD( MI, ScheduleTime, 20 ) 
  WHERE CAST( ScheduleTime AS TIME ) &gt;= '22:30:00' 
     OR CAST( ScheduleTime AS TIME ) &lt; '05:00:00';
  </code></pre>
  
  <p>But it is producing this error message...</p>
  
  <pre><code>#1305 - FUNCTION DatabaseName.DATEADD does not exist
  </code></pre>
  
  <p>This query can be used to create the table that I have...</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS TableName
  (
      product_id VARCHAR( 255 ) NOT NULL,
      ScheduleTime DATETIME NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  </code></pre>
  
  <p>I am populating the above table using the following sample data...</p>
  
  <pre><code>INSERT INTO TableName ( product_id,
                          ScheduleTime )
  VALUES ( '01', '2017-05-07 22:00:59' ),
         ( '02', '2017-05-07 09:09:59' ),
         ( '03', '2017-05-07 09:59:59' ),
         ( '04', '2017-05-07 09:49:59' ),
         ( '05', '2017-05-07 23:09:59' ),
         ( '06', '2017-05-07 23:09:59' ),
         ( '07', '2017-05-07 23:09:59' ),
         ( '08', '2017-05-07 23:09:59' ),
         ( '09', '2017-05-07 23:09:59' ),
         ( '10', '2017-05-07 23:09:59' ),
         ( '11', '2017-05-07 23:09:59' ),
         ( '12', '2017-05-07 23:09:59' ),
         ( '13', '2017-05-07 23:09:59' ),
         ( '14', '2017-05-07 23:09:59' ),
         ( '15', '2017-05-07 23:09:59' ),
         ( '16', '2017-05-07 23:09:59' ),
         ( '17', '2017-05-07 23:09:59' ),
         ( '18', '2017-05-07 23:09:59' ),
         ( '19', '2017-05-07 23:09:59' ),
         ( '20', '2017-05-07 23:09:59' );
  </code></pre>