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

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -