snipt

Ctrl+h for KB shortcuts

SQL

Restar o sumar dias a fecha en sql server

1
2
3
4
5
DATEADD(day, 1, @FechaInicial)



DATEADD(day, -1, @FechaInicial)
https://snipt.net/embed/3178ff1b5e34bab8fac97e5a07ccd9c3/
/raw/3178ff1b5e34bab8fac97e5a07ccd9c3/
3178ff1b5e34bab8fac97e5a07ccd9c3
sql
SQL
6
2019-08-17T08:14:44
True
False
False
/api/public/snipt/39993/
restar-o-sumar-dias-a-fecha-en-sql-server
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">DATEADD</span><span class="p">(</span><span class="k">day</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="o">@</span><span class="n">FechaInicial</span><span class="p">)</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="n">DATEADD</span><span class="p">(</span><span class="k">day</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">@</span><span class="n">FechaInicial</span><span class="p">)</span> </span></pre></div> </td></tr></table>
SQL