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

  • 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



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]