How do I in SQL Server 2005 use the DateAdd function to add a day to a date
SQL Server DATEADD() Function The DATEADD() function adds a time/date interval to a date and then returns the date.
DATEADD does not allow addition for a datepart of microsecond or nanosecond for date data types smalldatetime, date, and datetime.
Use the following function:
DATEADD(type, value, date)
date is the date you want to manipulate
value is the integere value you want to add (or subtract if you provide a negative number)
type is one of:
SELECT DATEADD(dd, 1, GETDATE()) will return a current date + 1 day
http://msdn.microsoft.com/en-us/library/ms186819.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With