SQL DATEADD with Variable
<p>Just wondering if I'm missing something really simple with the DATEADD and a variable and I'm sure there must be a more elegant way to do what I want.</p>

<p>I currently have a load of spiel but as part of that I have</p>

<pre><code>DECLARE @EndDate date

SET @EndDate = '2016-02-01'
SET @EndDate = DATEADD(DD,1, @EndDate)
</code></pre>

<p>Now in the final version the first @EndDate is set with a select statement however for testing I have to hardcode it in as it's generated as the user starts the report and rather than generate the report every single time it makes it simple.  The idea is that when the user inputs a date the search is inclusive of that date rather than just going up to midnight the day before.</p>

<p>If it helps here is the select statement that will be used.</p>

<pre><code>     DECLARE @EndDate date

    SET @EndDate = (SELECT atvcEndDate FROM tbUserReport WHERE atvcUserId = @UserId)
    SET @EndDate = DATEADD(DD,1, @EndDate)
</code></pre>

<p>Is there anyway to compress it down to one line, its not massive in the grand scheme of things but as this is something that will be in every storedproc we build for this it seems like something to save a bit of time (as well as expand my knowledge which is the real reason for me posting this!)</p>

<p>Cheers in advance.</p>