Skip to content
Advertisement

Get the 2 digit year in T-SQL

I need to get the current 2 digit year and increment by one. So the current number I’m looking for should be 11.

Probably really simple but I’m a sql noob 🙂

Thanks

Advertisement

Answer

You can do ( YEAR( GETDATE() ) % 100 ) + 1

See GETDATE & YEAR

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement