May 11, 2012 at 8:55 pm
hi
i want ot know date function ,that gives last 5 year date.
i have 1 param
declare @todate datetime
suppose @todate = '09/30/2010'
i want function that will return 09/30/2005
May 11, 2012 at 9:49 pm
declare @todate datetime
select @todate = '09/30/2010'
SELECT FiveYearsPrevious = DATEADD(yy,-5,@todate)
--Jeff Moden
Change is inevitable... Change for the better is not.
May 12, 2012 at 9:32 am
thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply