snipt

Ctrl+h for KB shortcuts

SQL

Increment date by 14 days

UPDATE events SET date_starts = DATE_ADD(date_starts,INTERVAL 14 DAY) WHERE event_id = 3;
https://snipt.net/embed/ccc397d6860ef356f43744d5b10c5f14/
/raw/ccc397d6860ef356f43744d5b10c5f14/
ccc397d6860ef356f43744d5b10c5f14
sql
SQL
1
2019-07-14T08:25:20
True
False
False
/api/public/snipt/38558/
increment-date-by-14-days
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">UPDATE</span> <span class="n">events</span> <span class="k">SET</span> <span class="n">date_starts</span> <span class="o">=</span> <span class="n">DATE_ADD</span><span class="p">(</span><span class="n">date_starts</span><span class="p">,</span><span class="nb">INTERVAL</span> <span class="mi">14</span> <span class="k">DAY</span><span class="p">)</span> <span class="k">WHERE</span> <span class="n">event_id</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span> </span></pre></div> </td></tr></table>
date, mysql, sql