Translate

Friday, 9 June 2017

SQL :no of Year back from given date or Subtract exactly a year from given date


DECLARE @FromDate date,@NoOfYearBack int;
set @FromDate= '2017-07-01'; set @NoOfYearBack=14;
select dateadd(year, -@NoOfYearBack, @FromDate)

No comments:

Post a Comment