Basit Khan

Basit Khan

  • NA
  • 336
  • 122.5k

How to get the Year Period as per the currentDate(GetDate())

Feb 19 2017 5:00 AM
Hi,
 
How to get the Year Period as per the currentDate(GetDate()) depend upon Joining Date.
 
For Example.
 
Emp_No     Joining Date        As per todaycurrentDate(His One year period End)
 
1                  14-Jul-2013                14-Jul-2017
2                   14-Jul-2016               14-Jul-2017 
3                  01-Feb-2015               01-Feb-2017
 
How to do the query?
 
I use the case but this one will not suite.
 
CASE WHEN JoinDate < GetDate() THEN dateadd(DAY , 365 , JoinDate) ELSE 0 END
 
Thanks
Basit. 
 

Answers (1)