Hi,
I want to determine the difference in Year i.e. total Years passed between two dates in SQL Server.
Please guide
Please use the SQL Server DATEDIFF function and pass YEAR as first parameter to get difference in years.
SELECT DATEDIFF(YEAR, '2004-02-07', '2025-02-10')
or pass GETDATE() for Current Date
SELECT DATEDIFF(YEAR, '2004-02-07', GETDATE())
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.