Monday, February 14, 2022

2 Digit Year in SQL Server


FORMAT(DATEADD(year, 1, getdate()), 'yy') 

-- In Select statement
Select FORMAT(DATEADD(year, 0, getdate()), 'yy')  from PRODDTA.F0010 where ccco='00000'

also you can add one year 
FORMAT(DATEADD(year, 1, getdate()), 'yy') 

No comments: