I got a DECLARE
statement like this
DECLARE ,@ACTIVATE DATETIME,
@DEACTIVATE DATETIME
I want to set the Activate
date as today's date, which is
SET @ACTIVATE = GETDATE()
I want to set the @DEACTIVATE
date to one year from the Activate
date.
ACTIVATE = 30/07/2018
DEACTIVATE = 30/07/2019
I can set DEACTIVATE
date using string, but is there any other function or method to do this?
Regards
Use the DATEADD
function:
SET @Deactivate = DATEADD(YEAR, 1, @Activate)