I need to create a function that returns a date 6 months from getutc date

  • I need some ideas on how to create a function that will return a date that is always exactly six months from the current getutcdate.

    Can some one please give me some ideas?

    Thanks

    SL

  • 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]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply