SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,671 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Heloo, I want to subtract 64.5 years in Eff_Date-2022-12-05 and want to get the result after subtracting 64.5 years (2022-12-05 minus 64.5 yrs).
Try
DECLARE @date DATE = '2022-12-05'
SELECT @date, DATEADD(MONTH, -1*64.5*12, @date) AS newDate
Try:
DECLARE @date DATE = '2022-12-05'
SELECT @date, DATEADD(MONTH, -1*64.5*12, @date) AS newDate