title: MySQL DATE_ADD() Function
body: <p>I am trying to update a date column based on an existing date column by adding days/weeks/months to the existing date</p>
  
  <pre><code>update Form_1 set `DateP1`= DATE_ADD(`Date`, INTERVAL `P1` week) where 
  `id`=1;
  </code></pre>
  
  <p>This works perfectly, however what I am trying to achieve is something like this which does not seem to work</p>
  
  <pre><code>update Form_1 set `DateP1`= DATE_ADD(`Date`, INTERVAL `P1` `TimeType`) where 
  `id`=1;
  </code></pre>
  
  <p>Here, the <code>TimeType</code> is another column in my table and contains values like day, week, month... basically the time information. I want to be able to pull value from the column dynamically instead of </p>
  
  <pre><code>DATE_ADD(`Date`, INTERVAL `P1` week)
  </code></pre>
  
  <p>where week is static. Is there a way to achieve this. I am OK with using any other alternate method as long as I can dynamically pull the values from the TimeType table. </p>