Monday, June 10, 2013

How to Select and add days or months or year in sql

SELECT DATEADD(dd, DATEDIFF(dd, 0, getdate())+1, 0)
Result : 2013-06-11 00:00:00.000

SELECT DATEADD(dd, DATEDIFF(dd, 0, '2013-04-05')+5, 0)
Result : 2013-04-10 00:00:00.000

No comments :

Post a Comment