Get Century from date in SQL server -


how can century year in date field using sql server query?

as, example, period 1901 - 2000 20th century. century, if try left substring of 2 , add 1 year, how can implement year '2000'?

is there function getting century date?

i think want:

select 1 + (year(date) - 1) / 100 century 

or alternatively:

select (year(date) + 99) / 100 century 

Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -