Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 what does this do ? DateAdd(day, 1, @STARTDATE

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-11-30 : 16:28:46
DECLARE @STARTDATENEW DATETIME
SET @STARTDATENEW = DateAdd(day, 1, @STARTDATE)

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2011-11-30 : 16:30:40
It adds one day to the date you have passed in @STARTDATE.

Try with getdate() and you will understand

DECLARE @STARTDATENEW DATETIME
SET @STARTDATENEW = DateAdd(day, 1, getdate())

select @STARTDATENEW
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-12-01 : 05:08:16
quote:
Originally posted by AdamWest

DECLARE @STARTDATENEW DATETIME
SET @STARTDATENEW = DateAdd(day, 1, @STARTDATE)



Have a look at DATEDIFF in SQL Server for more information

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -