Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

I need to create a function that returns a date 6 months from getutc date Expand / Collapse
Author
Message
Posted Thursday, July 29, 2010 3:09 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Yesterday @ 9:26 AM
Points: 72, Visits: 286
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
Post #961042
Posted Thursday, July 29, 2010 3:16 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, December 4, 2013 1:49 PM
Points: 1,104, Visits: 1,174
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
Post #961044
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse