I am trying to perform a little date manipulation on a value I will be passing in to a stored procedure.
Example Inputs;
31/12/2008
15/11/2007
21/05/2005
Expected Output;
31/12/2012
15/11/2012
21/05/2012
Formatted code from the answer provided;
DECLARE @date DATETIME = '31/12/2007'
DECLARE @year INT
SET @year = DATEPART(YEAR, GETDATE())
SELECT DATEADD(YEAR, @year - DATEPART(YEAR, @date), @date)
You are trying to convert the year component to 2012?