Question: How can I get century from the year in a date field using SQL server query?

As, for example, the period 1901 - 2000 is 20th century. To get century, if I try to get the left substring of 2 and add 1 from the year, then how can I implement for the year '2000'?

Is there any function for getting century from date?

Answer: 
I think this does what you want:

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

```

or alternatively:

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

```
```
select CEILING(year::decimal)/100 as century

```