Home Forums SQL Server 2008 SQL Server Newbies I need to create a function that returns a date 6 months from getutc date RE: I need to create a function that returns a date 6 months from getutc date
Ben Teraberry
SSChampion
Points: 11845
More actions
July 29, 2010 at 3:16 pm
#1200068
If you literally want exactly +6 months (including the hh:mm:ss) then ...
select DATEADD(mm, 6, GETUTCDATE())
Otherwise (if you just want the mm/dd/yy) then ..
select DATEADD(mm, 6, DATEADD(dd, DATEDIFF(dd, 0, GETUTCDATE()), 0))
└> bt