How to add days to the current date?

Fazil Mir picture Fazil Mir · Apr 11, 2014 · Viewed 221.4k times · Source

I am trying to add days to the current date and it's working fine but when I add 360 days to the current date it gives me wrong value.

eg: Current Date is 11/04/2014

And I am adding 360 Days to it, it should give me 11/04/2015, but it is showing the same date 11/04/2014. the year is not changing.

Here is my code:

select dateadd(dd,360,getdate())

Answer

Shahid Mustafa picture Shahid Mustafa · Sep 4, 2014

Just do-

Select (Getdate()+360) As MyDate

There is no need to use dateadd function for adding or subtracting days from a given date. For adding years, months, hours you need the dateadd function.